pub struct StateHandle { /* private fields */ }Expand description
Shared state handle for cross-workload communication and invariant checking.
Provides type-safe publish/get semantics using std::any::Any for type erasure.
Clone is cheap (Rc-based) — all clones share the same underlying storage.
Implementations§
Source§impl StateHandle
impl StateHandle
Sourcepub fn publish<T: Any + 'static>(&self, key: &str, value: T)
pub fn publish<T: Any + 'static>(&self, key: &str, value: T)
Publish a value under a key, replacing any existing value.
Trait Implementations§
Source§impl Clone for StateHandle
impl Clone for StateHandle
Source§fn clone(&self) -> StateHandle
fn clone(&self) -> StateHandle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StateHandle
impl Debug for StateHandle
Source§impl Default for StateHandle
impl Default for StateHandle
Source§fn default() -> StateHandle
fn default() -> StateHandle
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StateHandle
impl !RefUnwindSafe for StateHandle
impl !Send for StateHandle
impl !Sync for StateHandle
impl Unpin for StateHandle
impl UnsafeUnpin for StateHandle
impl !UnwindSafe for StateHandle
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