[][src]Struct tari_p2p::services::liveness::LivenessHandle

pub struct LivenessHandle { /* fields omitted */ }

Implementations

impl LivenessHandle[src]

pub fn new(
    handle: SenderService<LivenessRequest, Result<LivenessResponse, LivenessError>>,
    event_stream_sender: LivenessEventSender
) -> Self
[src]

pub fn get_event_stream_fused(&self) -> Fuse<Receiver<Arc<LivenessEvent>>>[src]

Returns a fused event stream for the liveness service

pub async fn send_ping<'_>(
    &'_ mut self,
    node_id: NodeId
) -> Result<(), LivenessError>
[src]

Send a ping to a given node ID

pub async fn get_ping_count<'_>(&'_ mut self) -> Result<usize, LivenessError>[src]

Retrieve the global ping count

pub async fn get_pong_count<'_>(&'_ mut self) -> Result<usize, LivenessError>[src]

Retrieve the global pong count

pub async fn set_pong_metadata_entry<'_>(
    &'_ mut self,
    key: MetadataKey,
    value: Vec<u8>
) -> Result<(), LivenessError>
[src]

Set metadata entry for the pong message

pub async fn add_node_id<'_>(
    &'_ mut self,
    node_id: NodeId
) -> Result<(), LivenessError>
[src]

Add NodeId to be monitored

pub async fn remove_node_id<'_>(
    &'_ mut self,
    node_id: NodeId
) -> Result<(), LivenessError>
[src]

Add NodeId to be monitored

pub async fn get_node_id_stats<'_>(
    &'_ mut self,
    node_id: NodeId
) -> Result<NodeStats, LivenessError>
[src]

Get stats for NodeId that is being monitored

pub async fn clear_node_ids<'_>(&'_ mut self) -> Result<(), LivenessError>[src]

Clear all NodeIds that are being monitored

Trait Implementations

impl Clone for LivenessHandle[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<T> CloneAny for T where
    T: Clone + Any

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<T> IntoSql for 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<T> UnsafeAny for T where
    T: Any

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