pub enum P2PEvent {
Connected {
peer_id: PeerId,
},
Disconnected {
peer_id: PeerId,
reason: Option<String>,
},
Data {
peer_id: PeerId,
data: Vec<u8>,
},
Error {
peer_id: Option<PeerId>,
error: P2PError,
},
}
Expand description
High-level P2P events
Variants§
Connected
Connected to a peer
Disconnected
Disconnected from a peer
Data
Received data from a peer
Error
Error occurred
Auto Trait Implementations§
impl Freeze for P2PEvent
impl RefUnwindSafe for P2PEvent
impl Send for P2PEvent
impl Sync for P2PEvent
impl Unpin for P2PEvent
impl UnwindSafe for P2PEvent
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