[−][src]Struct twitchchat::AsyncDecoder
This is supported on crate feature
async
only.A decoder over futures_lite::AsyncRead that produces IrcMessages
This will return an DecodeError::Eof when its done reading manually.
When reading it as a stream, Eof
will signal the end of the stream (e.g. None
)
Implementations
impl<R: AsyncRead + Send + Sync + Unpin> AsyncDecoder<R>
[src]
pub fn new(reader: R) -> Self
[src]
This is supported on crate feature
async
only.Create a new AsyncDecoder from this futures_lite::AsyncRead instance
pub async fn read_message<'_, '_>(
&'_ mut self
) -> Result<IrcMessage<'_>, DecodeError>
[src]
&'_ mut self
) -> Result<IrcMessage<'_>, DecodeError>
This is supported on crate feature
async
only.Read the next message.
This returns a borrowed IrcMessage which is valid until the next AsyncDecoder call is made.
If you just want an owned one, use the AsyncDecoder as an stream. e.g. dec.next().
pub fn into_inner(self) -> R
[src]
This is supported on crate feature
async
only.Consume the decoder returning the inner Reader
Trait Implementations
impl<R> Debug for AsyncDecoder<R>
[src]
impl<R> Stream for AsyncDecoder<R> where
R: AsyncRead + Send + Sync + Unpin,
[src]
R: AsyncRead + Send + Sync + Unpin,
This will produce Result<IrcMessage<'static>, DecodeError>
until an Eof
is received
Auto Trait Implementations
impl<R> RefUnwindSafe for AsyncDecoder<R> where
R: RefUnwindSafe,
R: RefUnwindSafe,
impl<R> Send for AsyncDecoder<R> where
R: Send,
R: Send,
impl<R> Sync for AsyncDecoder<R> where
R: Sync,
R: Sync,
impl<R> Unpin for AsyncDecoder<R> where
R: Unpin,
R: Unpin,
impl<R> UnwindSafe for AsyncDecoder<R> where
R: UnwindSafe,
R: UnwindSafe,
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,
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 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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<S, T, E> TryStream for S where
S: Stream<Item = Result<T, E>> + ?Sized,
[src]
S: Stream<Item = Result<T, E>> + ?Sized,