pub enum KademliaEvent {
FindNodeSuccess {
query_id: QueryId,
target: PeerId,
peers: Vec<(PeerId, Vec<Multiaddr>)>,
},
RoutingTableUpdate {
peers: Vec<PeerId>,
},
GetRecordSuccess {
query_id: QueryId,
records: RecordsType,
},
PutRecordSucess {
query_id: QueryId,
key: RecordKey,
},
QueryFailed {
query_id: QueryId,
},
IncomingRecord {
record: Record,
},
}
Expand description
Kademlia events.
Variants§
FindNodeSuccess
Result for the issued FIND_NODE
query.
Fields
RoutingTableUpdate
Routing table update.
Kademlia has discovered one or more peers that should be added to the routing table.
If RoutingTableUpdateMode
is Automatic
, user can ignore this event unless some
upper-level protocols has user for this information.
If the mode was set to Manual
, user should call KademliaHandle::add_known_peer()
in order to add the peers to routing table.
GetRecordSuccess
GET_VALUE
query succeeded.
PutRecordSucess
PUT_VALUE
query succeeded.
QueryFailed
Query failed.
IncomingRecord
Incoming PUT_VALUE
request received.
In case of using IncomingRecordValidationMode::Manual
and successful validation
the record must be manually inserted into the local DHT store with
KademliaHandle::store_record()
.
Trait Implementations§
source§impl Clone for KademliaEvent
impl Clone for KademliaEvent
source§fn clone(&self) -> KademliaEvent
fn clone(&self) -> KademliaEvent
Returns a copy 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 KademliaEvent
impl RefUnwindSafe for KademliaEvent
impl Send for KademliaEvent
impl Sync for KademliaEvent
impl Unpin for KademliaEvent
impl UnwindSafe for KademliaEvent
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)