[][src]Struct twitchchat::AsyncRunner

pub struct AsyncRunner {
    pub identity: Identity,
    // some fields omitted
}
This is supported on crate feature async only.

An asynchronous runner

Fields

identity: Identity

You identity that Twitch gives when you connected

Implementations

impl AsyncRunner[src]

pub async fn connect<C, '_>(
    connector: C,
    user_config: &'_ UserConfig
) -> Result<Self, Error> where
    C: Connector,
    &'a C::Output: AsyncRead + AsyncWrite + Send + Sync + Unpin
[src]

Connect with the provided connector and the provided UserConfig

This returns the Runner with your identity set.

pub fn is_on_channel(&self, channel: &str) -> bool[src]

Check whether you're on this channel

pub fn get_channel_mut(&mut self, channel: &str) -> Option<&mut Channel>[src]

Get a specific channel.

This is useful for changing the rate limit/state manually.

pub fn writer(&self) -> AsyncWriter<MpscWriter>

Notable traits for AsyncWriter<W>

impl<W> Write for AsyncWriter<W> where
    W: Write + Send + Sync
[src]

Get a clonable writer you can use

pub fn quit_handle(&self) -> NotifyHandle[src]

Get a handle that you can trigger a normal 'quit'.

You can also do AsyncWriter::quit.

pub async fn join<'_, '_>(&'_ mut self, channel: &'_ str) -> Result<(), Error>[src]

Join channel and wait for it to complete

pub async fn part<'_, '_>(&'_ mut self, channel: &'_ str) -> Result<(), Error>[src]

Part channel and wait for it to complete

pub async fn next_message<'_>(&'_ mut self) -> Result<Status<'static>, Error>[src]

Get the next message. You'll usually want to call this in a loop

pub async fn step<'_>(&'_ mut self) -> Result<StepResult<'static>, Error>[src]

Single step the loop. This is useful for testing.

Trait Implementations

impl Debug for AsyncRunner[src]

impl Stream for AsyncRunner[src]

type Item = Commands<'static>

Values yielded by the stream.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?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<S> StreamExt for S where
    S: Stream + ?Sized

impl<T> StreamExt for T where
    T: Stream + ?Sized

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.