Skip to main content

AsUpdateStream

Trait AsUpdateStream 

Source
pub trait AsUpdateStream<'a> {
    type StreamErr;
    type Stream: Stream<Item = Result<Update, Self::StreamErr>> + Send + 'a;

    // Required method
    fn as_stream(&'a mut self) -> Self::Stream;
}
Expand description

UpdateListener’s supertrait/extension.

This trait is a workaround to not require GAT.

Required Associated Types§

Source

type StreamErr

Error that can be returned from the Stream

Source

type Stream: Stream<Item = Result<Update, Self::StreamErr>> + Send + 'a

The stream of updates from Telegram.

Required Methods§

Source

fn as_stream(&'a mut self) -> Self::Stream

Creates the update Stream.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'a, B: Requester + Send + 'a> AsUpdateStream<'a> for Polling<B>

Source§

impl<'a, St, Assf, Sf, Hauf, Strm, E> AsUpdateStream<'a> for StatefulListener<St, Assf, Hauf, Sf>
where (St, Strm): 'a, Strm: Send + Stream<Item = Result<Update, E>>, Assf: FnMut(&'a mut St) -> Strm,

Source§

type StreamErr = E

Source§

type Stream = Strm