[−][src]Struct libp2prs_kad::Control
Implementations
impl Control
[src]
pub async fn close(&mut self)
[src]
Closes the Kad main loop and tasks.
pub async fn add_node(&mut self, peer_id: PeerId, addrs: Vec<Multiaddr>)
[src]
Add a node and its listening addresses to KBuckets.
pub async fn remove_node(&mut self, peer_id: PeerId)
[src]
Add a node and its listening addresses to KBuckets.
pub async fn dump_kbuckets(&mut self) -> Result<Vec<KBucketView>, KadError>
[src]
pub async fn dump_statistics(&mut self) -> Result<KademliaStats, KadError>
[src]
pub async fn dump_messengers(
&mut self
) -> Result<Vec<KadMessengerView>, KadError>
[src]
&mut self
) -> Result<Vec<KadMessengerView>, KadError>
pub async fn bootstrap(&mut self)
[src]
Initiate bootstrapping.
In general it should be done only once upon Kad startup.
pub async fn lookup(&mut self, key: Key) -> Result<Vec<KadPeer>, KadError>
[src]
Lookup the closer peers with the given key.
pub async fn find_peer(&mut self, peer_id: &PeerId) -> Result<KadPeer, KadError>
[src]
pub async fn put_value(
&mut self,
key: Vec<u8>,
value: Vec<u8>
) -> Result<(), KadError>
[src]
&mut self,
key: Vec<u8>,
value: Vec<u8>
) -> Result<(), KadError>
pub async fn get_value(&mut self, key: Vec<u8>) -> Result<Vec<u8>, KadError>
[src]
pub async fn provide(&mut self, key: Vec<u8>) -> Result<(), KadError>
[src]
pub async fn find_providers(
&mut self,
key: Vec<u8>,
count: usize
) -> Option<Vec<KadPeer>>
[src]
&mut self,
key: Vec<u8>,
count: usize
) -> Option<Vec<KadPeer>>
Trait Implementations
impl Clone for Control
[src]
impl Routing for Control
[src]
Implements Routing
for Kad Control. Therefore, Kad control can be used
by Swarm to find peers.
pub fn find_peer<'life0, 'life1, 'async_trait>(
&'life0 mut self,
peer_id: &'life1 PeerId
) -> Pin<Box<dyn Future<Output = Result<Vec<Multiaddr>, TransportError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self,
peer_id: &'life1 PeerId
) -> Pin<Box<dyn Future<Output = Result<Vec<Multiaddr>, TransportError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
pub fn box_clone(&self) -> IRouting
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Control
[src]
impl Send for Control
[src]
impl Sync for Control
[src]
impl Unpin for Control
[src]
impl !UnwindSafe for Control
[src]
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> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
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>,
V: MultiLane<T>,