[][src]Struct twitchchat::Control

pub struct Control { /* fields omitted */ }

A control type for writing messages to the client, or stopping it.

Implementations

impl Control[src]

pub fn writer(&mut self) -> &mut Writer[src]

This is supported on feature="tokio" only.

Get a mutable reference to the Writer

You can clone this to pass around it around

pub fn stop(&self)[src]

This is supported on feature="tokio" only.

Signal the client to stop

Example

let (mut runner, control) = Runner::new(Dispatcher::default());

// calling stop will cause 'run' to return Ok(Status::Canceled)
spawn(async move { control.stop() });

assert_eq!(runner.run_to_completion(conn).await.unwrap(), Status::Canceled);

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

This is supported on feature="tokio" only.

This will block until you're reconnected

If you've not connected yet then this won't block

This is useful for determining when a reconnect has happened

Trait Implementations

impl Clone for Control[src]

impl Debug for Control[src]

Auto Trait Implementations

impl !RefUnwindSafe for Control

impl Send for Control

impl Sync for Control

impl Unpin for Control

impl !UnwindSafe for Control

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