Struct tari_comms_dht::Dht[][src]

pub struct Dht { /* fields omitted */ }

Responsible for starting the DHT actor, building the DHT middleware stack and as a factory for producing DHT requesters.

Implementations

impl Dht[src]

pub async fn initialize(
    config: DhtConfig,
    node_identity: Arc<NodeIdentity>,
    peer_manager: Arc<PeerManager>,
    outbound_tx: Sender<DhtOutboundRequest>,
    connectivity: ConnectivityRequester,
    shutdown_signal: ShutdownSignal
) -> Result<Self, DhtInitializationError>
[src]

pub fn rpc_service(&self) -> DhtService<DhtRpcServiceImpl>[src]

Create a DHT RPC service

pub fn outbound_requester(&self) -> OutboundMessageRequester[src]

Return a new OutboundMessageRequester connected to the receiver

pub fn dht_requester(&self) -> DhtRequester[src]

Returns a requester for the DhtActor associated with this instance

pub fn discovery_service_requester(&self) -> DhtDiscoveryRequester[src]

Returns a requester for the DhtDiscoveryService associated with this instance

pub fn store_and_forward_requester(&self) -> StoreAndForwardRequester[src]

Returns a requester for the StoreAndForwardService associated with this instance

pub fn subscribe_dht_events(&self) -> DhtEventReceiver[src]

Get a subscription to DhtEvents

pub fn inbound_middleware_layer<S>(
    &self
) -> impl Layer<S, Service = impl Service<InboundMessage, Response = (), Error = PipelineError, Future = impl Future<Output = Result<(), PipelineError>> + Send> + Clone + Send> where
    S: Service<DecryptedDhtMessage, Response = (), Error = PipelineError> + Clone + Send + Sync + 'static,
    S::Future: Send
[src]

Returns an the full DHT stack as a tower::layer::Layer. This can be composed with other inbound middleware services which expect an DecryptedDhtMessage

pub fn outbound_middleware_layer<S>(
    &self
) -> impl Layer<S, Service = impl Service<DhtOutboundRequest, Response = (), Error = PipelineError, Future = impl Future<Output = Result<(), PipelineError>> + Send> + Clone + Send> where
    S: Service<OutboundMessage, Response = (), Error = PipelineError> + Clone + Send + 'static,
    S::Future: Send
[src]

Returns an the full DHT stack as a tower::layer::Layer. This can be composed with other outbound middleware services which expect an OutboundMessage

Trait Implementations

impl Clone for Dht[src]

Auto Trait Implementations

impl !RefUnwindSafe for Dht[src]

impl Send for Dht[src]

impl Sync for Dht[src]

impl Unpin for Dht[src]

impl !UnwindSafe for Dht[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> Cast<U> for T where
    U: FromCast<T>, 

impl<'a, T> DefaultFeatures<'a> for T where
    T: 'a + Clone + Send + Sync

impl<T> From<T> for T[src]

impl<T> FromBits<T> for T

impl<T> FromCast<T> for T

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> IntoBits<U> for T where
    U: FromBits<T>, 

impl<T> IntoSql for T[src]

impl<'a, T> NonSyncFeatures<'a> for T where
    T: 'a + Clone

impl<T> SafeBorrow<T> for T where
    T: ?Sized

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,