QueryStream

Trait QueryStream 

Source
pub trait QueryStream<T, C>
where C: Client,
{ // Required methods fn stream<'life0, 'life1, 'async_trait>( &'life0 mut self, client: &'life1 C, ) -> Pin<Box<dyn Future<Output = Result<XmtpStream<<C as Client>::Stream, T>, ApiClientError<C::Error>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn fake_stream( &mut self, client: &C, ) -> XmtpStream<<C as Client>::Stream, T>; }
Expand description

a companion to the Query trait, except for streaming calls. Not every query combinator/extension will apply to both steams and one-off calls (how do you ‘page’ a streaming api?), so these traits are separated.

Required Methods§

Source

fn stream<'life0, 'life1, 'async_trait>( &'life0 mut self, client: &'life1 C, ) -> Pin<Box<dyn Future<Output = Result<XmtpStream<<C as Client>::Stream, T>, ApiClientError<C::Error>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

stream items from an endpoint QueryStreamExt::subscribe or [crate::api::stream_as] should be used to indicate the type of item in the stream.

Source

fn fake_stream(&mut self, client: &C) -> XmtpStream<<C as Client>::Stream, T>

Implementors§

Source§

impl<E, T, C> QueryStream<T, C> for E
where E: Endpoint, C: Client, T: Default + Message + 'static,