Enum libp2p_kad::handler::KademliaHandlerEvent [−][src]
Event produced by the Kademlia handler.
Variants
The configured protocol name has been confirmed by the peer through a successfully negotiated substream.
This event is only emitted once by a handler upon the first successfully negotiated inbound or outbound substream and indicates that the connected peer participates in the Kademlia overlay network identified by the configured protocol name.
Fields of ProtocolConfirmed
endpoint: ConnectedPointRequest for the list of nodes whose IDs are the closest to key. The number of nodes
returned is not specified, but should be around 20.
Fields of FindNodeReq
key: Vec<u8>The key for which to locate the closest nodes.
request_id: KademliaRequestIdIdentifier of the request. Needs to be passed back when answering.
Response to an KademliaHandlerIn::FindNodeReq.
Fields of FindNodeRes
Same as FindNodeReq, but should also return the entries of the local providers list for
this key.
Fields of GetProvidersReq
key: KeyThe key for which providers are requested.
request_id: KademliaRequestIdIdentifier of the request. Needs to be passed back when answering.
Response to an KademliaHandlerIn::GetProvidersReq.
Fields of GetProvidersRes
An error happened when performing a query.
Fields of QueryError
error: KademliaHandlerQueryErrThe error that happened.
user_data: TUserDataThe user data passed to the query.
The peer announced itself as a provider of a key.
Fields of AddProvider
Request to get a value from the dht records
Fields of GetRecord
key: KeyKey for which we should look in the dht
request_id: KademliaRequestIdIdentifier of the request. Needs to be passed back when answering.
Response to a KademliaHandlerIn::GetRecord.
Fields of GetRecordRes
Request to put a value in the dht records
Fields of PutRecord
record: Recordrequest_id: KademliaRequestIdIdentifier of the request. Needs to be passed back when answering.
Response to a request to store a record.
Fields of PutRecordRes
Trait Implementations
impl<TUserData: Debug> Debug for KademliaHandlerEvent<TUserData>[src]
Auto Trait Implementations
impl<TUserData> !RefUnwindSafe for KademliaHandlerEvent<TUserData>
impl<TUserData> Send for KademliaHandlerEvent<TUserData> where
TUserData: Send,
TUserData: Send,
impl<TUserData> Sync for KademliaHandlerEvent<TUserData> where
TUserData: Sync,
TUserData: Sync,
impl<TUserData> Unpin for KademliaHandlerEvent<TUserData> where
TUserData: Unpin,
TUserData: Unpin,
impl<TUserData> !UnwindSafe for KademliaHandlerEvent<TUserData>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Same<T> for T[src]
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>, [src]
V: MultiLane<T>,