Trait reth_eth_wire::CanDisconnect

source ·
pub trait CanDisconnect<T>: Sink<T> + Unpin {
    // Required method
    fn disconnect(
        &mut self,
        reason: DisconnectReason,
    ) -> impl Future<Output = Result<(), <Self as Sink<T>>::Error>> + Send;
}
Expand description

This trait is meant to allow higher level protocols like eth to disconnect from a peer, using lower-level disconnect functions (such as those that exist in the p2p protocol) if the underlying stream supports it.

Required Methods§

source

fn disconnect( &mut self, reason: DisconnectReason, ) -> impl Future<Output = Result<(), <Self as Sink<T>>::Error>> + Send

Disconnects from the underlying stream, using a DisconnectReason as disconnect information if the stream implements a protocol that can carry the additional disconnect metadata.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<S> CanDisconnect<Bytes> for ECIESStream<S>
where S: AsyncWrite + Unpin + Send,

source§

async fn disconnect(&mut self, _reason: DisconnectReason) -> Result<(), Error>

source§

impl<T, I, U> CanDisconnect<I> for Framed<T, U>
where T: AsyncWrite + Unpin + Send, U: Encoder<I> + Send,

source§

async fn disconnect( &mut self, _reason: DisconnectReason, ) -> Result<(), <Self as Sink<I>>::Error>

Implementors§

source§

impl CanDisconnect<Bytes> for ProtocolProxy

source§

impl<S> CanDisconnect<EthMessage> for EthStream<S>
where S: CanDisconnect<Bytes> + Send, EthStreamError: From<<S as Sink<Bytes>>::Error>,

source§

impl<S> CanDisconnect<Bytes> for P2PStream<S>
where S: Sink<Bytes, Error = Error> + Unpin + Send + Sync,