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