pub struct SimulatedNode {
pub node_id: NodeId,
/* private fields */
}Expand description
A simulated ELARA node for integration testing. Simplified version that focuses on presence and degradation tracking.
Fields§
§node_id: NodeIdNode identity
Implementations§
Source§impl SimulatedNode
impl SimulatedNode
Sourcepub fn emit_message(&mut self, content: Vec<u8>) -> SimulatedMessage
pub fn emit_message(&mut self, content: Vec<u8>) -> SimulatedMessage
Generate a message from this node
Sourcepub fn receive_message(&mut self, msg: &SimulatedMessage) -> bool
pub fn receive_message(&mut self, msg: &SimulatedMessage) -> bool
Receive a message
Sourcepub fn update_presence(&mut self, factor: f32)
pub fn update_presence(&mut self, factor: f32)
Update presence based on network conditions
Sourcepub fn degradation_level(&self) -> DegradationLevel
pub fn degradation_level(&self) -> DegradationLevel
Get current degradation level
Sourcepub fn presence(&self) -> &PresenceVector
pub fn presence(&self) -> &PresenceVector
Get presence vector
Sourcepub fn version(&self) -> &VersionVector
pub fn version(&self) -> &VersionVector
Get version vector
Sourcepub fn message_count(&self) -> usize
pub fn message_count(&self) -> usize
Get message count
Auto Trait Implementations§
impl Freeze for SimulatedNode
impl RefUnwindSafe for SimulatedNode
impl Send for SimulatedNode
impl Sync for SimulatedNode
impl Unpin for SimulatedNode
impl UnsafeUnpin for SimulatedNode
impl UnwindSafe for SimulatedNode
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