pub struct SimulatedAgent { /* private fields */ }Expand description
Minimal CRDT model for simulation: each agent tracks a grow-only set of event IDs.
Implementations§
Source§impl SimulatedAgent
impl SimulatedAgent
Sourcepub fn emit_event(&mut self) -> EmittedEvent
pub fn emit_event(&mut self) -> EmittedEvent
Emit a new event and apply it to local state immediately.
Sourcepub fn observe_event(&mut self, event_id: u64)
pub fn observe_event(&mut self, event_id: u64)
Apply a delivered event.
Sourcepub fn snapshot(&self) -> AgentState
pub fn snapshot(&self) -> AgentState
Get an immutable snapshot of current local state.
Trait Implementations§
Source§impl Clone for SimulatedAgent
impl Clone for SimulatedAgent
Source§fn clone(&self) -> SimulatedAgent
fn clone(&self) -> SimulatedAgent
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 SimulatedAgent
impl Debug for SimulatedAgent
Source§impl PartialEq for SimulatedAgent
impl PartialEq for SimulatedAgent
impl Eq for SimulatedAgent
impl StructuralPartialEq for SimulatedAgent
Auto Trait Implementations§
impl Freeze for SimulatedAgent
impl RefUnwindSafe for SimulatedAgent
impl Send for SimulatedAgent
impl Sync for SimulatedAgent
impl Unpin for SimulatedAgent
impl UnsafeUnpin for SimulatedAgent
impl UnwindSafe for SimulatedAgent
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