[][src]Struct tari_comms_dht::Dht

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 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

Auto Trait Implementations

impl !RefUnwindSafe for Dht

impl Send for Dht

impl Sync for Dht

impl Unpin for Dht

impl !UnwindSafe for Dht

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<T> From<T> for T[src]

impl<T> FromBits<T> for T

impl<T> FromCast<T> for T

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<T> SafeBorrow<T> for T where
    T: ?Sized

impl<T> Same<T> for T

type Output = T

Should always be Self

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>,