Enum libp2p_kad::handler::KademliaHandlerIn [−][src]
Event to send to the handler.
Variants
Reset(KademliaRequestId)
Resets the (sub)stream associated with the given request ID, thus signaling an error to the remote.
Explicitly resetting the (sub)stream associated with a request can be used as an alternative to letting requests simply time out on the remote peer, thus potentially avoiding some delay for the query on the remote.
Request 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
Response to a FindNodeReq
.
Fields of FindNodeRes
closer_peers: Vec<KadPeer>
Results of the request.
request_id: KademliaRequestId
Identifier of the request that was made by the remote.
It is a logic error to use an id of the handler of a different node.
Same as FindNodeReq
, but should also return the entries of the local providers list for
this key.
Fields of GetProvidersReq
key: Key
Identifier being searched.
user_data: TUserData
Custom user data. Passed back in the out event when the results arrive.
Response to a GetProvidersReq
.
Fields of GetProvidersRes
closer_peers: Vec<KadPeer>
Nodes closest to the key.
provider_peers: Vec<KadPeer>
Known providers for this key.
request_id: KademliaRequestId
Identifier of the request that was made by the remote.
It is a logic error to use an id of the handler of a different node.
Indicates that this provider is known for this key.
The API of the handler doesn’t expose any event that allows you to know whether this succeeded.
Fields of AddProvider
Request to retrieve a record from the DHT.
Fields of GetRecord
key: Key
The key of the record.
user_data: TUserData
Custom data. Passed back in the out event when the results arrive.
Response to a GetRecord
request.
Fields of GetRecordRes
record: Option<Record>
The value that might have been found in our storage.
closer_peers: Vec<KadPeer>
Nodes that are closer to the key we were searching for.
request_id: KademliaRequestId
Identifier of the request that was made by the remote.
Put a value into the dht records.
Fields of PutRecord
record: Record
user_data: TUserData
Custom data. Passed back in the out event when the results arrive.
Response to a PutRecord
.
Fields of PutRecordRes
key: Key
Key of the value that was put.
value: Vec<u8>
Value that was put.
request_id: KademliaRequestId
Identifier of the request that was made by the remote.
Trait Implementations
impl<TUserData: Clone> Clone for KademliaHandlerIn<TUserData>
[src]
fn clone(&self) -> KademliaHandlerIn<TUserData>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<TUserData: Debug> Debug for KademliaHandlerIn<TUserData>
[src]
Auto Trait Implementations
impl<TUserData> RefUnwindSafe for KademliaHandlerIn<TUserData> where
TUserData: RefUnwindSafe,
TUserData: RefUnwindSafe,
impl<TUserData> Send for KademliaHandlerIn<TUserData> where
TUserData: Send,
TUserData: Send,
impl<TUserData> Sync for KademliaHandlerIn<TUserData> where
TUserData: Sync,
TUserData: Sync,
impl<TUserData> Unpin for KademliaHandlerIn<TUserData> where
TUserData: Unpin,
TUserData: Unpin,
impl<TUserData> UnwindSafe for KademliaHandlerIn<TUserData> where
TUserData: UnwindSafe,
TUserData: UnwindSafe,
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,