pub struct PeerConnection { /* private fields */ }Expand description
A cloneable handle to one verified peer identity.
Initial Node::connect eagerly establishes the
session and synchronizes routes before returning this handle. Transport loss
updates the handle but does not start background work. Call reconnect
explicitly to perform one ordered endpoint sweep; concurrent calls share the
same in-flight attempt and result.
Implementations§
Source§impl PeerConnection
impl PeerConnection
pub fn peer(&self) -> &str
pub fn status(&self) -> ConnectionStatus
pub fn changed(&self) -> impl Future<Output = ConnectionStatus> + Send + 'static
pub fn disconnect(&self)
pub async fn reconnect(&self) -> Result<(), ConnectError>
Trait Implementations§
Source§impl Clone for PeerConnection
impl Clone for PeerConnection
Source§fn clone(&self) -> PeerConnection
fn clone(&self) -> PeerConnection
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for PeerConnection
impl !UnwindSafe for PeerConnection
impl Freeze for PeerConnection
impl Send for PeerConnection
impl Sync for PeerConnection
impl Unpin for PeerConnection
impl UnsafeUnpin for PeerConnection
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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