pub enum NetworkEvent {
PeerJoined(AgentIdentity),
PeerLeft(Uuid),
MessageReceived(MessageEnvelope),
ConnectionStateChanged {
transport: TransportType,
state: ConnectionState,
},
Error(NetworkError),
}Expand description
Events emitted by the networking stack.
Subscribe to these via NetworkManager::subscribe() to react to
peer changes, incoming messages, and connection state transitions.
Variants§
PeerJoined(AgentIdentity)
A new peer was discovered or joined the network.
PeerLeft(Uuid)
A peer left the network or became unreachable.
MessageReceived(MessageEnvelope)
A message was received from the network.
ConnectionStateChanged
A transport’s connection state changed.
Error(NetworkError)
A network-level error occurred.
Trait Implementations§
Source§impl Clone for NetworkEvent
impl Clone for NetworkEvent
Source§fn clone(&self) -> NetworkEvent
fn clone(&self) -> NetworkEvent
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 moreAuto Trait Implementations§
impl Freeze for NetworkEvent
impl RefUnwindSafe for NetworkEvent
impl Send for NetworkEvent
impl Sync for NetworkEvent
impl Unpin for NetworkEvent
impl UnsafeUnpin for NetworkEvent
impl UnwindSafe for NetworkEvent
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