Struct hypercore_protocol::Duplex[][src]

pub struct Duplex<R, W> where
    R: AsyncRead + Send + Unpin + 'static,
    W: AsyncWrite + Send + Unpin + 'static, 
{ /* fields omitted */ }

Duplex IO stream from reader and writer halves.

Convert an AsyncRead reader and AsyncWrite writer into a AsyncRead + AsyncWrite stream

Implementations

impl<R, W> Duplex<R, W> where
    R: AsyncRead + Send + Unpin + 'static,
    W: AsyncWrite + Send + Unpin + 'static, 
[src]

pub fn new(reader: R, writer: W) -> Self[src]

Create a new Duplex stream from a reader and a writer.

Trait Implementations

impl<R, W> AsyncRead for Duplex<R, W> where
    R: AsyncRead + Send + Unpin + 'static,
    W: AsyncWrite + Send + Unpin + 'static, 
[src]

impl<R, W> AsyncWrite for Duplex<R, W> where
    R: AsyncRead + Send + Unpin + 'static,
    W: AsyncWrite + Send + Unpin + 'static, 
[src]

impl<R: Clone, W: Clone> Clone for Duplex<R, W> where
    R: AsyncRead + Send + Unpin + 'static,
    W: AsyncWrite + Send + Unpin + 'static, 
[src]

impl<R: Debug, W: Debug> Debug for Duplex<R, W> where
    R: AsyncRead + Send + Unpin + 'static,
    W: AsyncWrite + Send + Unpin + 'static, 
[src]

impl<R: PartialEq, W: PartialEq> PartialEq<Duplex<R, W>> for Duplex<R, W> where
    R: AsyncRead + Send + Unpin + 'static,
    W: AsyncWrite + Send + Unpin + 'static, 
[src]

impl<R, W> StructuralPartialEq for Duplex<R, W> where
    R: AsyncRead + Send + Unpin + 'static,
    W: AsyncWrite + Send + Unpin + 'static, 
[src]

Auto Trait Implementations

impl<R, W> RefUnwindSafe for Duplex<R, W> where
    R: RefUnwindSafe,
    W: RefUnwindSafe

impl<R, W> Send for Duplex<R, W>

impl<R, W> Sync for Duplex<R, W> where
    R: Sync,
    W: Sync

impl<R, W> Unpin for Duplex<R, W>

impl<R, W> UnwindSafe for Duplex<R, W> where
    R: UnwindSafe,
    W: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<R> AsyncReadExt for R where
    R: AsyncRead + ?Sized
[src]

impl<W> AsyncWriteExt for W where
    W: AsyncWrite + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,