pub struct DhtService(/* private fields */);Implementations§
Source§impl DhtService
impl DhtService
pub fn builder(local_id: PeerId) -> DhtServiceBuilder
pub fn local_id(&self) -> &PeerId
pub fn make_client(&self, network: &Network) -> DhtClient
pub fn make_peer_resolver(&self) -> PeerResolverBuilder
pub fn has_peer(&self, peer_id: &PeerId) -> bool
pub fn find_local_closest( &self, key: &[u8; 32], count: usize, ) -> Vec<Arc<PeerInfo>>
pub fn store_value_locally( &self, value: &ValueRef<'_>, ) -> Result<bool, StorageError>
pub fn insert_merger( &self, group_id: &[u8; 32], merger: Arc<dyn DhtValueMerger>, ) -> Option<Arc<dyn DhtValueMerger>>
pub fn remove_merger( &self, group_id: &[u8; 32], ) -> Option<Arc<dyn DhtValueMerger>>
pub fn peer_added(&self) -> &Arc<Notify>
Trait Implementations§
Source§impl Clone for DhtService
impl Clone for DhtService
Source§fn clone(&self) -> DhtService
fn clone(&self) -> DhtService
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Routable for DhtService
impl Routable for DhtService
fn query_ids(&self) -> impl IntoIterator<Item = u32>
fn message_ids(&self) -> impl IntoIterator<Item = u32>
Source§impl Service<ServiceRequest> for DhtService
impl Service<ServiceRequest> for DhtService
type QueryResponse = Response
type OnQueryFuture = Ready<Option<<DhtService as Service<ServiceRequest>>::QueryResponse>>
type OnMessageFuture = Ready<()>
Source§fn on_query(&self, req: ServiceRequest) -> Self::OnQueryFuture
fn on_query(&self, req: ServiceRequest) -> Self::OnQueryFuture
Called when a query is received. Read more
Source§fn on_message(&self, req: ServiceRequest) -> Self::OnMessageFuture
fn on_message(&self, req: ServiceRequest) -> Self::OnMessageFuture
Called when a message is received.
Auto Trait Implementations§
impl Freeze for DhtService
impl !RefUnwindSafe for DhtService
impl Send for DhtService
impl Sync for DhtService
impl Unpin for DhtService
impl !UnwindSafe for DhtService
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more