FilterWithRequest

Trait FilterWithRequest 

Source
pub trait FilterWithRequest<TFilter, TResponse>
where TFilter: Serialize + Sync + Send + 'static, TResponse: Serialize + DeserializeOwned, Self: WithApiClient + WithBasePath + Sync,
{ // Provided methods fn filter( &self, filter: TFilter, ) -> impl Future<Output = Result<ItemsVec<TResponse, Cursor>>> + Send { ... } fn filter_all( &self, filter: TFilter, ) -> impl Future<Output = Result<Vec<TResponse>>> + Send where TFilter: SetCursor, TResponse: Send { ... } fn filter_all_stream( &self, filter: TFilter, ) -> impl TryStream<Ok = TResponse, Error = Error, Item = Result<TResponse>> + Send where TFilter: SetCursor, TResponse: Send + 'static { ... } fn filter_all_partitioned( &self, filter: TFilter, num_partitions: u32, ) -> impl Future<Output = Result<Vec<TResponse>>> + Send where TFilter: SetCursor + WithPartition, TResponse: Send { ... } fn filter_all_partitioned_stream( &self, filter: TFilter, num_partitions: u32, ) -> impl TryStream<Ok = TResponse, Error = Error, Item = Result<TResponse>> + Send where TFilter: SetCursor + WithPartition, TResponse: Send + 'static { ... } }
Expand description

Trait for resource types that allow filtering with a more complex request.

Provided Methods§

Source

fn filter( &self, filter: TFilter, ) -> impl Future<Output = Result<ItemsVec<TResponse, Cursor>>> + Send

Filter resources.

§Arguments
  • filter - Filter which items to retrieve.
Source

fn filter_all( &self, filter: TFilter, ) -> impl Future<Output = Result<Vec<TResponse>>> + Send
where TFilter: SetCursor, TResponse: Send,

Filter resources, following cursors until they are exhausted.

§Arguments
  • filter - Filter which items to retrieve.
Source

fn filter_all_stream( &self, filter: TFilter, ) -> impl TryStream<Ok = TResponse, Error = Error, Item = Result<TResponse>> + Send
where TFilter: SetCursor, TResponse: Send + 'static,

Filter resources, following cursors. This returns a stream, you can abort the stream whenever you want and only resources retrieved up to that point will be returned.

Each item in the stream will be a result, after the first error is returned the stream will end.

§Arguments
  • filter - Filter which items to retrieve.
Source

fn filter_all_partitioned( &self, filter: TFilter, num_partitions: u32, ) -> impl Future<Output = Result<Vec<TResponse>>> + Send
where TFilter: SetCursor + WithPartition, TResponse: Send,

Filter resources using partitioned reads, following cursors until all partitions are exhausted.

§Arguments
  • filter - Filter which items to retrieve.
  • num_partitions - Number of partitions.
Source

fn filter_all_partitioned_stream( &self, filter: TFilter, num_partitions: u32, ) -> impl TryStream<Ok = TResponse, Error = Error, Item = Result<TResponse>> + Send
where TFilter: SetCursor + WithPartition, TResponse: Send + 'static,

Filter resources using partitioned reads, following cursors until all partitions are exhausted. This returns a stream.

Note that the returned stream is simply a combinator of streams returned by filter_all_stream for different partitions.

The order of the returned values is not guaranteed to be in any way consistent.

§Arguments
  • filter - Filter which items to retrieve.
  • num_partitions - Number of partitions.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§