[][src]Struct tari_comms::connectivity::ConnectivityRequester

pub struct ConnectivityRequester { /* fields omitted */ }

Implementations

impl ConnectivityRequester[src]

pub fn new(
    sender: Sender<ConnectivityRequest>,
    event_tx: ConnectivityEventTx
) -> Self
[src]

pub fn subscribe_event_stream(&self) -> ConnectivityEventRx[src]

pub async fn dial_peer<'_>(
    &'_ mut self,
    peer: NodeId
) -> Result<PeerConnection, ConnectivityError>
[src]

pub async fn add_managed_peers<'_>(
    &'_ mut self,
    peers: Vec<NodeId>
) -> Result<(), ConnectivityError>
[src]

pub async fn remove_peer<'_>(
    &'_ mut self,
    peer: NodeId
) -> Result<(), ConnectivityError>
[src]

pub async fn select_connections<'_>(
    &'_ mut self,
    selection: ConnectivitySelection
) -> Result<Vec<PeerConnection>, ConnectivityError>
[src]

pub async fn get_connection<'_>(
    &'_ mut self,
    node_id: NodeId
) -> Result<Option<PeerConnection>, ConnectivityError>
[src]

Get an active connection to the given node id if one exists. This will return None if the peer is not connected.

pub async fn get_connectivity_status<'_>(
    &'_ mut self
) -> Result<ConnectivityStatus, ConnectivityError>
[src]

pub async fn get_all_connection_states<'_>(
    &'_ mut self
) -> Result<Vec<PeerConnectionState>, ConnectivityError>
[src]

pub async fn ban_peer<'_>(
    &'_ mut self,
    node_id: NodeId,
    duration: Duration
) -> Result<(), ConnectivityError>
[src]

pub async fn wait_for_connectivity<'_>(
    &'_ mut self,
    timeout: Duration
) -> Result<(), ConnectivityError>
[src]

Waits for the node to get at least one connection. This is useful for testing and is not typically be needed in application code.

Trait Implementations

impl Clone for ConnectivityRequester[src]

Auto Trait Implementations

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, U> Into<U> for T where
    U: From<T>, 
[src]

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

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