pub struct PeerConnection<T: Transport> { /* private fields */ }Expand description
Relationship with one remote peer, bound to a transport context.
Generic over T: Transport — works with LocalNode (unicast) or
BoundChannel (blind unicast) identically.
Implementations§
Source§impl<T: Transport> PeerConnection<T>
impl<T: Transport> PeerConnection<T>
Sourcepub async fn send(
&self,
payload: &[u8],
options: &SendOptions,
) -> Result<SendProgressTicket, T::Error>
pub async fn send( &self, payload: &[u8], options: &SendOptions, ) -> Result<SendProgressTicket, T::Error>
Send a raw payload to this peer (delegates to transport.send()).
Source§impl<M: MacBackend> PeerConnection<LocalNode<M>>
impl<M: MacBackend> PeerConnection<LocalNode<M>>
pub fn on_receive<F>(&self, handler: F) -> Subscription
pub fn on_ack_received<F>(&self, handler: F) -> Subscription
pub fn on_ack_timeout<F>(&self, handler: F) -> Subscription
pub fn on_pfs_established<F>(&self, handler: F) -> Subscriptionwhere
F: FnMut() + 'static,
pub fn on_pfs_ended<F>(&self, handler: F) -> Subscriptionwhere
F: FnMut() + 'static,
pub async fn request_pfs( &self, duration_minutes: u16, options: &SendOptions, ) -> Result<SendProgressTicket, NodeError<M>>
pub async fn end_pfs(&self, options: &SendOptions) -> Result<(), NodeError<M>>
pub fn pfs_status(&self) -> Result<PfsStatus, NodeError<M>>
Trait Implementations§
Source§impl<T: Clone + Transport> Clone for PeerConnection<T>
impl<T: Clone + Transport> Clone for PeerConnection<T>
Source§fn clone(&self) -> PeerConnection<T>
fn clone(&self) -> PeerConnection<T>
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for PeerConnection<T>where
T: Freeze,
impl<T> RefUnwindSafe for PeerConnection<T>where
T: RefUnwindSafe,
impl<T> Send for PeerConnection<T>where
T: Send,
impl<T> Sync for PeerConnection<T>where
T: Sync,
impl<T> Unpin for PeerConnection<T>where
T: Unpin,
impl<T> UnwindSafe for PeerConnection<T>where
T: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)