pub enum PeerConnectionState {
Idle,
DisconnectingIn,
DisconnectingOut,
In,
Out,
PendingOut,
}
Expand description
Represents the kind of connection established to the peer, if any
Variants§
Idle
Not connected currently.
DisconnectingIn
Disconnect of an incoming connection in progress
DisconnectingOut
Disconnect of an outgoing connection in progress
In
Connected via incoming connection.
Out
Connected via outgoing connection.
PendingOut
Pending outgoing connection.
Implementations§
Source§impl PeerConnectionState
impl PeerConnectionState
Sourcepub fn disconnect(&mut self)
pub fn disconnect(&mut self)
Sets the disconnect state
Sourcepub const fn is_incoming(&self) -> bool
pub const fn is_incoming(&self) -> bool
Returns true if this is an active incoming connection.
Sourcepub const fn is_connected(&self) -> bool
pub const fn is_connected(&self) -> bool
Returns whether we’re currently connected with this peer
Sourcepub const fn is_unconnected(&self) -> bool
pub const fn is_unconnected(&self) -> bool
Returns if there’s currently no connection to that peer.
Sourcepub const fn is_pending_out(&self) -> bool
pub const fn is_pending_out(&self) -> bool
Returns true if there’s currently an outbound dial to that peer.
Trait Implementations§
Source§impl Clone for PeerConnectionState
impl Clone for PeerConnectionState
Source§fn clone(&self) -> PeerConnectionState
fn clone(&self) -> PeerConnectionState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for PeerConnectionState
impl Debug for PeerConnectionState
Source§impl Default for PeerConnectionState
impl Default for PeerConnectionState
Source§fn default() -> PeerConnectionState
fn default() -> PeerConnectionState
Source§impl PartialEq for PeerConnectionState
impl PartialEq for PeerConnectionState
impl Copy for PeerConnectionState
impl Eq for PeerConnectionState
impl StructuralPartialEq for PeerConnectionState
Auto Trait Implementations§
impl Freeze for PeerConnectionState
impl RefUnwindSafe for PeerConnectionState
impl Send for PeerConnectionState
impl Sync for PeerConnectionState
impl Unpin for PeerConnectionState
impl UnwindSafe for PeerConnectionState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 1 byte
Size for each variant:
Idle
: 0 bytesDisconnectingIn
: 0 bytesDisconnectingOut
: 0 bytesIn
: 0 bytesOut
: 0 bytesPendingOut
: 0 bytes