pub enum KademliaCommand {
AddKnownPeer {
peer: PeerId,
addresses: Vec<Multiaddr>,
},
FindNode {
peer: PeerId,
query_id: QueryId,
},
PutRecord {
record: Record,
quorum: Quorum,
query_id: QueryId,
},
PutRecordToPeers {
record: Record,
quorum: Quorum,
query_id: QueryId,
peers: Vec<PeerId>,
update_local_store: bool,
},
GetRecord {
key: RecordKey,
quorum: Quorum,
query_id: QueryId,
},
GetProviders {
key: RecordKey,
query_id: QueryId,
},
StartProviding {
key: RecordKey,
quorum: Quorum,
query_id: QueryId,
},
StopProviding {
key: RecordKey,
},
StoreRecord {
record: Record,
},
}Expand description
Kademlia commands.
Variants§
AddKnownPeer
Add known peer.
FindNode
Send FIND_NODE message.
PutRecord
Store record to DHT.
Fields
PutRecordToPeers
Store record to DHT to the given peers.
Similar to KademliaCommand::PutRecord but allows user to specify the peers.
Fields
GetRecord
Get record from DHT.
Fields
GetProviders
Get providers from DHT.
StartProviding
Register as a content provider for key.
Fields
StopProviding
Stop providing the key locally and refreshing the provider.
StoreRecord
Store record locally.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for KademliaCommand
impl RefUnwindSafe for KademliaCommand
impl Send for KademliaCommand
impl Sync for KademliaCommand
impl Unpin for KademliaCommand
impl UnwindSafe for KademliaCommand
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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