[][src]Struct ntex::testing::Io

pub struct Io { /* fields omitted */ }

Async io stream

Methods

impl Io[src]

pub fn create() -> (Io, Io)[src]

Create a two interconnected streams

pub fn is_client_dropped(&self) -> bool[src]

pub fn is_server_dropped(&self) -> bool[src]

pub fn is_closed(&self) -> bool[src]

Check if channel is closed from remoote side

pub fn read_pending(&self)[src]

Set read to Pending state

pub fn read_error(&self, err: Error)[src]

Set read to error

pub fn local_buffer<F, R>(&self, f: F) -> R where
    F: FnOnce(&mut BytesMut) -> R, 
[src]

Access read buffer.

pub fn remote_buffer<F, R>(&self, f: F) -> R where
    F: FnOnce(&mut BytesMut) -> R, 
[src]

Access remote buffer.

pub async fn close<'_>(&'_ self)[src]

Closed remote side.

pub fn write<T: AsRef<[u8]>>(&self, data: T)[src]

Add extra data to the remote buffer and notify reader

pub fn remote_buffer_cap(&self, cap: usize)[src]

Read any available data

pub fn read_any(&self) -> BytesMut[src]

Read any available data

pub async fn read<'_>(&'_ self) -> Result<BytesMut, Error>[src]

Read data, if data is not available wait for it

Trait Implementations

impl AsyncRead for Io[src]

impl AsyncWrite for Io[src]

impl Clone for Io[src]

impl Debug for Io[src]

impl Drop for Io[src]

Auto Trait Implementations

impl !RefUnwindSafe for Io

impl !Send for Io

impl !Sync for Io

impl Unpin for Io

impl !UnwindSafe for Io

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>,