Struct Snapshot
pub struct Snapshot {
pub state: BTreeMap<String, Payload>,
pub calls: VecDeque<Kept>,
}Expand description
A key’s state and remembered calls: the input of each of its runs.
Fields§
§state: BTreeMap<String, Payload>JSON values, as their handlers encoded them.
calls: VecDeque<Kept>Oldest first.
Implementations§
§impl Snapshot
impl Snapshot
pub fn encode(&self) -> Vec<u8> ⓘ
pub fn encode(&self) -> Vec<u8> ⓘ
{"state":{...},"calls":[{"id","status","result"|"error"|"result64","at"}]},
fields left out when empty (an empty key is {}).
pub fn decode(p: &[u8]) -> Result<Self>
pub fn prune(&mut self, now_ms: u64)
pub fn prune(&mut self, now_ms: u64)
Keeps the newest call per ID, at most KEPT_CALLS, none older
than KEPT_CALL_MS.
Trait Implementations§
impl Eq for Snapshot
impl StructuralPartialEq for Snapshot
Auto Trait Implementations§
impl Freeze for Snapshot
impl RefUnwindSafe for Snapshot
impl Send for Snapshot
impl Sync for Snapshot
impl Unpin for Snapshot
impl UnsafeUnpin for Snapshot
impl UnwindSafe for Snapshot
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more