pub struct P2PState { /* private fields */ }Expand description
In-memory P2P state for all known identities.
Used by the P2P Explorer UI to display connection and resolution status.
Implementations§
Source§impl P2PState
impl P2PState
Sourcepub async fn get(&self, id: RostraId) -> IdP2PState
pub async fn get(&self, id: RostraId) -> IdP2PState
Get the P2P state for a specific identity.
Sourcepub async fn get_all(&self) -> HashMap<RostraId, IdP2PState>
pub async fn get_all(&self) -> HashMap<RostraId, IdP2PState>
Get P2P state for all known identities.
Sourcepub async fn get_node(&self, node_id: IrohNodeId) -> NodeP2PState
pub async fn get_node(&self, node_id: IrohNodeId) -> NodeP2PState
Get the P2P state for a specific node.
Sourcepub async fn get_all_nodes(&self) -> HashMap<IrohNodeId, NodeP2PState>
pub async fn get_all_nodes(&self) -> HashMap<IrohNodeId, NodeP2PState>
Get P2P state for all known nodes.
Sourcepub async fn is_node_in_backoff(&self, node_id: IrohNodeId) -> bool
pub async fn is_node_in_backoff(&self, node_id: IrohNodeId) -> bool
Check if a node is currently in backoff.
Sourcepub async fn get_node_backoff_remaining(
&self,
node_id: IrohNodeId,
) -> Option<Duration>
pub async fn get_node_backoff_remaining( &self, node_id: IrohNodeId, ) -> Option<Duration>
Get the remaining backoff duration for a node, if any.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for P2PState
impl !RefUnwindSafe for P2PState
impl Send for P2PState
impl Sync for P2PState
impl Unpin for P2PState
impl UnsafeUnpin for P2PState
impl UnwindSafe for P2PState
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<F, T> ExpectFrom<F> for T
impl<F, T> ExpectFrom<F> for T
fn expect_from(other: F) -> T
Source§impl<F, I> ExpectInto<I> for Fwhere
I: ExpectFrom<F>,
impl<F, I> ExpectInto<I> for Fwhere
I: ExpectFrom<F>,
fn expect_into(self) -> I
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