[][src]Struct twitchchat::test::TestConn

pub struct TestConn { /* fields omitted */ }

A test connection that you can use to insert into and read messages from.

Implementations

impl TestConn[src]

pub fn new() -> Self[src]

This is supported on crate feature testing only.

Create a new TestConn

pub fn reset(&self) -> Self[src]

This is supported on crate feature testing only.

Reset the instance and returning a clone

pub async fn write_data<'_>(&'_ self, data: impl AsRef<[u8]>)[src]

This is supported on crate feature testing only.

Write data to the underlying buffers.

Whatever uses AsyncRead on this type will read from this buffer

pub async fn read_all_lines<'_>(&'_ self) -> Result<Vec<String>>[src]

This is supported on crate feature testing only.

Read all of the lines written via AsyncWrite

pub async fn read_line<'_>(&'_ self) -> Result<String>[src]

This is supported on crate feature testing only.

Read the first line written via an AsyncWrite

Trait Implementations

impl<'_> AsyncRead for &'_ TestConn[src]

impl AsyncRead for TestConn[src]

impl<'_> AsyncWrite for &'_ TestConn[src]

impl AsyncWrite for TestConn[src]

impl Clone for TestConn[src]

impl Debug for TestConn[src]

impl Default for TestConn[src]

Auto Trait Implementations

impl !RefUnwindSafe for TestConn

impl Send for TestConn

impl Sync for TestConn

impl Unpin for TestConn

impl !UnwindSafe for TestConn

Blanket Implementations

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

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

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

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> FuturesAsyncReadCompatExt for T where
    T: AsyncRead
[src]

impl<T> FuturesAsyncWriteCompatExt for T where
    T: AsyncWrite
[src]

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

impl<T> ReadExt for T where
    T: AsyncRead + ?Sized

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<T> WriteExt for T where
    T: AsyncWrite + ?Sized