pub struct DockSnapshotCache { /* private fields */ }Implementations§
Source§impl DockSnapshotCache
impl DockSnapshotCache
pub fn new() -> Self
Sourcepub fn census(&self) -> Held
pub fn census(&self) -> Held
How many nodes are kept, for how many blocks, and an estimate of their bytes. For the
srv memory log line (mem_census).
Sourcepub fn push_delta(&self, block_id: &str, node: DockNodeSnapshot)
pub fn push_delta(&self, block_id: &str, node: DockNodeSnapshot)
Record (or overwrite) one node’s latest status for block_id. Every SWEEP_EVERY_MS a push
also drops what has aged out anywhere in the cache, judged by this node’s stamp: the cache
then holds at most the last hour’s nodes, and a walk of it every five minutes is the cost.
Sourcepub fn get(&self, block_id: &str, now_ms: i64) -> Vec<DockNodeSnapshot>
pub fn get(&self, block_id: &str, now_ms: i64) -> Vec<DockNodeSnapshot>
All tracked nodes for block_id younger than MAX_NODE_AGE_MS as
of now_ms, or empty if none/unknown block. Evicts anything older
in that block as a side effect, and the block with its last node.
Sourcepub fn has_node(&self, block_id: &str, node_id: &str) -> bool
pub fn has_node(&self, block_id: &str, node_id: &str) -> bool
Whether node_id is currently tracked for block_id — used to
validate a dock clear request before publishing the clear event,
so muxspect can distinguish “cleared” from “no such node.”
Sourcepub fn remove_node(&self, block_id: &str, node_id: &str)
pub fn remove_node(&self, block_id: &str, node_id: &str)
Drop a node from the cache — called once a dock clear has been
published, so a subsequent dock read doesn’t keep showing a node
that was just cleared (the clearing renderer flips it to
"canceled" locally, but this cache has no way to observe that
without another push; removing it here is simpler and correct
either way — a canceled node isn’t “stuck” and doesn’t need to
keep appearing in diagnosis output).
Sourcepub fn evict_block(&self, block_id: &str)
pub fn evict_block(&self, block_id: &str)
Drop every tracked node for block_id: its pane is gone (sagas::close_pane::finish_close).
A status pushed for it afterwards (a renderer still settling) ages out with the sweep.
Trait Implementations§
Source§impl Default for DockSnapshotCache
impl Default for DockSnapshotCache
Source§fn default() -> DockSnapshotCache
fn default() -> DockSnapshotCache
Auto Trait Implementations§
impl !Freeze for DockSnapshotCache
impl !RefUnwindSafe for DockSnapshotCache
impl Send for DockSnapshotCache
impl Sync for DockSnapshotCache
impl Unpin for DockSnapshotCache
impl UnsafeUnpin for DockSnapshotCache
impl UnwindSafe for DockSnapshotCache
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more