DisconnectP2P

Trait DisconnectP2P 

pub trait DisconnectP2P {
    // Required methods
    fn start_disconnect(
        &mut self,
        reason: DisconnectReason,
    ) -> Result<(), P2PStreamError>;
    fn is_disconnecting(&self) -> bool;
}
Available on crate feature network only.
Expand description

Gracefully disconnects the connection by sending a disconnect message and stop reading new messages.

Required Methods§

fn start_disconnect( &mut self, reason: DisconnectReason, ) -> Result<(), P2PStreamError>

Starts to gracefully disconnect.

fn is_disconnecting(&self) -> bool

Returns true if the connection is about to disconnect.

Implementors§

§

impl<S> DisconnectP2P for P2PStream<S>