pub trait DisconnectP2P {
// Required methods
fn start_disconnect(
&mut self,
reason: DisconnectReason,
) -> Result<(), P2PStreamError>;
fn is_disconnecting(&self) -> bool;
}
Expand description
Gracefully disconnects the connection by sending a disconnect message and stop reading new messages.
Required Methods§
Sourcefn start_disconnect(
&mut self,
reason: DisconnectReason,
) -> Result<(), P2PStreamError>
fn start_disconnect( &mut self, reason: DisconnectReason, ) -> Result<(), P2PStreamError>
Starts to gracefully disconnect.
Sourcefn is_disconnecting(&self) -> bool
fn is_disconnecting(&self) -> bool
Returns true
if the connection is about to disconnect.