pub enum P2PEvent {
Show 18 variants
PeerDiscovered {
peer_id: String,
addresses: Vec<String>,
},
PeerConnected {
peer_id: String,
},
PeerDisconnected {
peer_id: String,
},
PeerIdentified {
peer_id: String,
agent_version: String,
},
Listening {
address: String,
},
ShareReceived {
from_peer: String,
cid: String,
},
ShareSent {
to_peer: String,
cid: String,
},
ShareFailed {
to_peer: Option<String>,
error: String,
},
BootstrapComplete,
DhtRecordFound {
key: String,
},
DhtRecordStored {
key: String,
},
NatStatusChanged {
status: String,
},
HolePunchSucceeded {
peer_id: String,
},
InboxReplayIgnored {
sender_peer_id: String,
seq: u64,
last_good_seq: u64,
},
InboxForkDetected {
sender_peer_id: String,
seq: u64,
expected_prev: Option<String>,
actual_prev: Option<String>,
},
ShareSendAttempt {
to_peer: String,
method: String,
},
EnvelopeFetchQueued {
cid: String,
from_peer: String,
},
EnvelopeFetchFailed {
cid: String,
error: String,
},
}Expand description
Events emitted during P2P networking operations.
Variants§
PeerDiscovered
A peer was discovered on the network.
Fields
PeerConnected
Connected to a peer.
PeerDisconnected
Disconnected from a peer.
PeerIdentified
A peer was identified with additional metadata.
Listening
Local node started listening on an address.
A share was received from a peer.
A share was sent to a peer.
A share operation failed.
BootstrapComplete
DHT bootstrap completed.
DhtRecordFound
DHT record was found.
DhtRecordStored
DHT record was stored.
NatStatusChanged
NAT status changed.
HolePunchSucceeded
Hole punch succeeded.
InboxReplayIgnored
An inbox head was ignored due to replay detection (seq already seen).
Fields
InboxForkDetected
A fork was detected in the inbox chain (same seq, different prev).
Fields
A share send was attempted.
EnvelopeFetchQueued
An envelope fetch was queued for retrieval.
EnvelopeFetchFailed
An envelope fetch failed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for P2PEvent
impl RefUnwindSafe for P2PEvent
impl Send for P2PEvent
impl Sync for P2PEvent
impl Unpin for P2PEvent
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more