[−][src]Struct twitchchat::AsyncRunner
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]
connector: C,
user_config: &'_ UserConfig
) -> Result<Self, Error> where
C: Connector,
&'a C::Output: AsyncRead + AsyncWrite + Send + Sync + Unpin,
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]
Notable traits for AsyncWriter<W>
impl<W> Write for AsyncWriter<W> where
W: Write + Send + Sync,
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]
Auto Trait Implementations
impl !RefUnwindSafe for AsyncRunner
impl Send for AsyncRunner
impl Sync for AsyncRunner
impl Unpin for AsyncRunner
impl !UnwindSafe for AsyncRunner
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<S> StreamExt for S where
S: Stream + ?Sized,
S: Stream + ?Sized,
fn poll_next(&mut self, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> where
Self: Unpin,
Self: Unpin,
fn next(&mut self) -> NextFuture<'_, Self> where
Self: Unpin,
Self: Unpin,
fn try_next<T, E>(&mut self) -> TryNextFuture<'_, Self> where
Self: Stream<Item = Result<T, E>> + Unpin,
Self: Stream<Item = Result<T, E>> + Unpin,
fn count(self) -> CountFuture<Self>
fn map<T, F>(self, f: F) -> Map<Self, F> where
F: FnMut(Self::Item) -> T,
F: FnMut(Self::Item) -> T,
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F> where
F: FnMut(Self::Item) -> U,
U: Stream,
F: FnMut(Self::Item) -> U,
U: Stream,
fn flatten(self) -> Flatten<Self> where
Self::Item: Stream,
Self::Item: Stream,
fn then<F, Fut>(self, f: F) -> Then<Self, F, Fut> where
F: FnMut(Self::Item) -> Fut,
Fut: Future,
F: FnMut(Self::Item) -> Fut,
Fut: Future,
fn filter<P>(self, predicate: P) -> Filter<Self, P> where
P: FnMut(&Self::Item) -> bool,
P: FnMut(&Self::Item) -> bool,
fn filter_map<T, F>(self, f: F) -> FilterMap<Self, F> where
F: FnMut(Self::Item) -> Option<T>,
F: FnMut(Self::Item) -> Option<T>,
fn take(self, n: usize) -> Take<Self>
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P> where
P: FnMut(&Self::Item) -> bool,
P: FnMut(&Self::Item) -> bool,
fn skip(self, n: usize) -> Skip<Self>
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P> where
P: FnMut(&Self::Item) -> bool,
P: FnMut(&Self::Item) -> bool,
fn step_by(self, step: usize) -> StepBy<Self>
fn chain<U>(self, other: U) -> Chain<Self, U> where
U: Stream<Item = Self::Item>,
U: Stream<Item = Self::Item>,
fn cloned<'a, T>(self) -> Cloned<Self> where
Self: Stream<Item = &'a T>,
T: Clone + 'a,
Self: Stream<Item = &'a T>,
T: Clone + 'a,
fn copied<'a, T>(self) -> Copied<Self> where
Self: Stream<Item = &'a T>,
T: Copy + 'a,
Self: Stream<Item = &'a T>,
T: Copy + 'a,
fn collect<C>(self) -> CollectFuture<Self, C> where
C: Default + Extend<Self::Item>,
C: Default + Extend<Self::Item>,
fn try_collect<T, E, C>(self) -> TryCollectFuture<Self, C> where
C: Default + Extend<T>,
Self: Stream<Item = Result<T, E>>,
C: Default + Extend<T>,
Self: Stream<Item = Result<T, E>>,
fn partition<B, P>(self, predicate: P) -> PartitionFuture<Self, P, B> where
B: Default + Extend<Self::Item>,
P: FnMut(&Self::Item) -> bool,
B: Default + Extend<Self::Item>,
P: FnMut(&Self::Item) -> bool,
fn fold<T, F>(self, init: T, f: F) -> FoldFuture<Self, F, T> where
F: FnMut(T, Self::Item) -> T,
F: FnMut(T, Self::Item) -> T,
fn try_fold<T, E, F, B>(
&mut self,
init: B,
f: F
) -> TryFoldFuture<'_, Self, F, B> where
F: FnMut(B, T) -> Result<B, E>,
Self: Stream<Item = Result<T, E>> + Unpin,
&mut self,
init: B,
f: F
) -> TryFoldFuture<'_, Self, F, B> where
F: FnMut(B, T) -> Result<B, E>,
Self: Stream<Item = Result<T, E>> + Unpin,
fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F> where
F: FnMut(&mut St, Self::Item) -> Option<B>,
F: FnMut(&mut St, Self::Item) -> Option<B>,
fn fuse(self) -> Fuse<Self>
fn cycle(self) -> Cycle<Self> where
Self: Clone,
Self: Clone,
fn enumerate(self) -> Enumerate<Self>
fn inspect<F>(self, f: F) -> Inspect<Self, F> where
F: FnMut(&Self::Item),
F: FnMut(&Self::Item),
fn nth(&mut self, n: usize) -> NthFuture<'_, Self> where
Self: Unpin,
Self: Unpin,
fn last(self) -> LastFuture<Self>
fn find<P>(&mut self, predicate: P) -> FindFuture<'_, Self, P> where
P: FnMut(&Self::Item) -> bool,
Self: Unpin,
P: FnMut(&Self::Item) -> bool,
Self: Unpin,
fn find_map<F, B>(&mut self, f: F) -> FindMapFuture<'_, Self, F> where
F: FnMut(Self::Item) -> Option<B>,
Self: Unpin,
F: FnMut(Self::Item) -> Option<B>,
Self: Unpin,
fn position<P>(&mut self, predicate: P) -> PositionFuture<'_, Self, P> where
P: FnMut(Self::Item) -> bool,
Self: Unpin,
P: FnMut(Self::Item) -> bool,
Self: Unpin,
fn all<P>(&mut self, predicate: P) -> AllFuture<'_, Self, P> where
P: FnMut(Self::Item) -> bool,
Self: Unpin,
P: FnMut(Self::Item) -> bool,
Self: Unpin,
fn any<P>(&mut self, predicate: P) -> AnyFuture<'_, Self, P> where
P: FnMut(Self::Item) -> bool,
Self: Unpin,
P: FnMut(Self::Item) -> bool,
Self: Unpin,
fn for_each<F>(self, f: F) -> ForEachFuture<Self, F> where
F: FnMut(Self::Item),
F: FnMut(Self::Item),
fn try_for_each<F, E>(&mut self, f: F) -> TryForEachFuture<'_, Self, F> where
F: FnMut(Self::Item) -> Result<(), E>,
Self: Unpin,
F: FnMut(Self::Item) -> Result<(), E>,
Self: Unpin,
fn zip<U>(self, other: U) -> Zip<Self, U> where
U: Stream,
U: Stream,
fn unzip<A, B, FromA, FromB>(self) -> UnzipFuture<Self, FromA, FromB> where
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
Self: Stream<Item = (A, B)>,
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
Self: Stream<Item = (A, B)>,
fn or<S>(self, other: S) -> Or<Self, S> where
S: Stream<Item = Self::Item>,
S: Stream<Item = Self::Item>,
fn race<S>(self, other: S) -> Race<Self, S> where
S: Stream<Item = Self::Item>,
S: Stream<Item = Self::Item>,
fn boxed<'a>(self) -> Pin<Box<dyn Stream<Item = Self::Item> + 'a + Send>> where
Self: Send + 'a,
Self: Send + 'a,
fn boxed_local<'a>(self) -> Pin<Box<dyn Stream<Item = Self::Item> + 'a>> where
Self: 'a,
Self: 'a,
impl<T> StreamExt for T where
T: Stream + ?Sized,
T: Stream + ?Sized,
fn next(&mut self) -> NextFuture<'_, Self> where
Self: Unpin,
Self: Unpin,
fn take(self, n: usize) -> Take<Self>
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P> where
P: FnMut(&Self::Item) -> bool,
P: FnMut(&Self::Item) -> bool,
fn step_by(self, step: usize) -> StepBy<Self>
fn chain<U>(self, other: U) -> Chain<Self, U> where
U: Stream<Item = Self::Item>,
U: Stream<Item = Self::Item>,
fn cloned<'a, T>(self) -> Cloned<Self> where
Self: Stream<Item = &'a T>,
T: Clone + 'a,
Self: Stream<Item = &'a T>,
T: Clone + 'a,
fn copied<'a, T>(self) -> Copied<Self> where
Self: Stream<Item = &'a T>,
T: Copy + 'a,
Self: Stream<Item = &'a T>,
T: Copy + 'a,
fn cycle(self) -> Cycle<Self> where
Self: Clone,
Self: Clone,
fn enumerate(self) -> Enumerate<Self>
fn map<B, F>(self, f: F) -> Map<Self, F> where
F: FnMut(Self::Item) -> B,
F: FnMut(Self::Item) -> B,
fn inspect<F>(self, f: F) -> Inspect<Self, F> where
F: FnMut(&Self::Item),
F: FnMut(&Self::Item),
fn last(self) -> LastFuture<Self, Self::Item>
fn fuse(self) -> Fuse<Self>
fn filter<P>(self, predicate: P) -> Filter<Self, P> where
P: FnMut(&Self::Item) -> bool,
P: FnMut(&Self::Item) -> bool,
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F> where
F: FnMut(Self::Item) -> Option<B>,
F: FnMut(Self::Item) -> Option<B>,
fn min_by_key<B, F>(self, key_by: F) -> MinByKeyFuture<Self, Self::Item, F> where
B: Ord,
F: FnMut(&Self::Item) -> B,
B: Ord,
F: FnMut(&Self::Item) -> B,
fn max_by_key<B, F>(self, key_by: F) -> MaxByKeyFuture<Self, Self::Item, F> where
B: Ord,
F: FnMut(&Self::Item) -> B,
B: Ord,
F: FnMut(&Self::Item) -> B,
fn min_by<F>(self, compare: F) -> MinByFuture<Self, F, Self::Item> where
F: FnMut(&Self::Item, &Self::Item) -> Ordering,
F: FnMut(&Self::Item, &Self::Item) -> Ordering,
fn max(self) -> MaxFuture<Self, Self::Item> where
Self::Item: Ord,
Self::Item: Ord,
fn min(self) -> MinFuture<Self, Self::Item> where
Self::Item: Ord,
Self::Item: Ord,
fn max_by<F>(self, compare: F) -> MaxByFuture<Self, F, Self::Item> where
F: FnMut(&Self::Item, &Self::Item) -> Ordering,
F: FnMut(&Self::Item, &Self::Item) -> Ordering,
fn nth(&mut self, n: usize) -> NthFuture<'_, Self> where
Self: Unpin,
Self: Unpin,
fn all<F>(&mut self, f: F) -> AllFuture<'_, Self, F, Self::Item> where
F: FnMut(Self::Item) -> bool,
Self: Unpin,
F: FnMut(Self::Item) -> bool,
Self: Unpin,
fn find<P>(&mut self, p: P) -> FindFuture<'_, Self, P> where
P: FnMut(&Self::Item) -> bool,
Self: Unpin,
P: FnMut(&Self::Item) -> bool,
Self: Unpin,
fn find_map<F, B>(&mut self, f: F) -> FindMapFuture<'_, Self, F> where
F: FnMut(Self::Item) -> Option<B>,
Self: Unpin,
F: FnMut(Self::Item) -> Option<B>,
Self: Unpin,
fn fold<B, F>(self, init: B, f: F) -> FoldFuture<Self, F, B> where
F: FnMut(B, Self::Item) -> B,
F: FnMut(B, Self::Item) -> B,
fn for_each<F>(self, f: F) -> ForEachFuture<Self, F> where
F: FnMut(Self::Item),
F: FnMut(Self::Item),
fn any<F>(&mut self, f: F) -> AnyFuture<'_, Self, F, Self::Item> where
F: FnMut(Self::Item) -> bool,
Self: Unpin,
F: FnMut(Self::Item) -> bool,
Self: Unpin,
fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F> where
F: FnMut(&mut St, Self::Item) -> Option<B>,
F: FnMut(&mut St, Self::Item) -> Option<B>,
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P> where
P: FnMut(&Self::Item) -> bool,
P: FnMut(&Self::Item) -> bool,
fn skip(self, n: usize) -> Skip<Self>
fn try_fold<B, F, T, E>(
&mut self,
init: T,
f: F
) -> TryFoldFuture<'_, Self, F, T> where
F: FnMut(B, Self::Item) -> Result<T, E>,
Self: Unpin,
&mut self,
init: T,
f: F
) -> TryFoldFuture<'_, Self, F, T> where
F: FnMut(B, Self::Item) -> Result<T, E>,
Self: Unpin,
fn try_for_each<F, E>(&mut self, f: F) -> TryForEachFuture<'_, Self, F> where
F: FnMut(Self::Item) -> Result<(), E>,
Self: Unpin,
F: FnMut(Self::Item) -> Result<(), E>,
Self: Unpin,
fn zip<U>(self, other: U) -> Zip<Self, U> where
U: Stream,
U: Stream,
fn partial_cmp<S>(self, other: S) -> PartialCmpFuture<Self, S> where
S: Stream,
Self: Stream,
Self::Item: PartialOrd<<S as Stream>::Item>,
S: Stream,
Self: Stream,
Self::Item: PartialOrd<<S as Stream>::Item>,
fn position<P>(&mut self, predicate: P) -> PositionFuture<'_, Self, P> where
P: FnMut(Self::Item) -> bool,
Self: Unpin,
P: FnMut(Self::Item) -> bool,
Self: Unpin,
fn cmp<S>(self, other: S) -> CmpFuture<Self, S> where
S: Stream,
Self: Stream,
Self::Item: Ord,
S: Stream,
Self: Stream,
Self::Item: Ord,
fn ne<S>(self, other: S) -> NeFuture<Self, S> where
S: Stream,
Self::Item: PartialEq<<S as Stream>::Item>,
S: Stream,
Self::Item: PartialEq<<S as Stream>::Item>,
fn ge<S>(self, other: S) -> GeFuture<Self, S> where
S: Stream,
Self: Stream,
Self::Item: PartialOrd<<S as Stream>::Item>,
S: Stream,
Self: Stream,
Self::Item: PartialOrd<<S as Stream>::Item>,
fn eq<S>(self, other: S) -> EqFuture<Self, S> where
S: Stream,
Self: Stream,
Self::Item: PartialEq<<S as Stream>::Item>,
S: Stream,
Self: Stream,
Self::Item: PartialEq<<S as Stream>::Item>,
fn gt<S>(self, other: S) -> GtFuture<Self, S> where
S: Stream,
Self: Stream,
Self::Item: PartialOrd<<S as Stream>::Item>,
S: Stream,
Self: Stream,
Self::Item: PartialOrd<<S as Stream>::Item>,
fn le<S>(self, other: S) -> LeFuture<Self, S> where
S: Stream,
Self: Stream,
Self::Item: PartialOrd<<S as Stream>::Item>,
S: Stream,
Self: Stream,
Self::Item: PartialOrd<<S as Stream>::Item>,
fn lt<S>(self, other: S) -> LtFuture<Self, S> where
S: Stream,
Self: Stream,
Self::Item: PartialOrd<<S as Stream>::Item>,
S: Stream,
Self: Stream,
Self::Item: PartialOrd<<S as Stream>::Item>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,