pub struct ClientStore { /* private fields */ }Expand description
In-memory store of the latest client states keyed by TaskId.
This type is intended to live on the UI/runtime side and be fed by
a ClientReporter running in simulation threads.
Implementations§
Source§impl ClientStore
impl ClientStore
Sourcepub fn new() -> (ClientReporter, Self)
pub fn new() -> (ClientReporter, Self)
Create a new store and a paired reporter that feeds it.
Sourcepub fn drain(&mut self)
pub fn drain(&mut self)
Drain all pending updates and merge them into the store.
This is non-blocking and processes all currently queued updates.
Sourcepub fn snapshot(&self) -> Vec<ClientState>
pub fn snapshot(&self) -> Vec<ClientState>
Return a snapshot of the latest known state for all clients.
The snapshot is a cloned vector to keep read access independent from the store’s internal mutation.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ClientStore
impl RefUnwindSafe for ClientStore
impl Send for ClientStore
impl !Sync for ClientStore
impl Unpin for ClientStore
impl UnwindSafe for ClientStore
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
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>
Converts
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>
Converts
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