pub enum KadRequestMsg {
Ping,
FindNode {
key: Vec<u8, Global>,
},
GetProviders {
key: Key,
},
AddProvider {
key: Key,
provider: KadPeer,
},
GetValue {
key: Key,
},
PutValue {
record: Record,
},
}
Expand description
Request that we can send to a peer or that we received from a peer.
Variants
Ping
Ping request.
FindNode
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.
GetProviders
Fields
key: Key
Identifier being searched.
Same as FindNode
, but should also return the entries of the local providers list for
this key.
AddProvider
Indicates that this list of providers is known for this key.
GetValue
Fields
key: Key
The key we are searching for.
Request to get a value from the dht records.
PutValue
Fields
record: Record
Request to put a value into the dht records.
Trait Implementations
sourceimpl Clone for KadRequestMsg
impl Clone for KadRequestMsg
sourcepub fn clone(&self) -> KadRequestMsg
pub fn clone(&self) -> KadRequestMsg
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for KadRequestMsg
impl Debug for KadRequestMsg
sourceimpl PartialEq<KadRequestMsg> for KadRequestMsg
impl PartialEq<KadRequestMsg> for KadRequestMsg
sourcepub fn eq(&self, other: &KadRequestMsg) -> bool
pub fn eq(&self, other: &KadRequestMsg) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcepub fn ne(&self, other: &KadRequestMsg) -> bool
pub fn ne(&self, other: &KadRequestMsg) -> bool
This method tests for !=
.
impl Eq for KadRequestMsg
impl StructuralEq for KadRequestMsg
impl StructuralPartialEq for KadRequestMsg
Auto Trait Implementations
impl RefUnwindSafe for KadRequestMsg
impl Send for KadRequestMsg
impl Sync for KadRequestMsg
impl Unpin for KadRequestMsg
impl UnwindSafe for KadRequestMsg
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more