pub struct MultiForkByErrorProvider<P, F> {
    providers: Vec<P>,
    predicate: F,
}Expand description
A provider that returns data from the first child provider passing a predicate function.
This is an abstract forking provider that must be provided with a type implementing the
ForkByErrorPredicate trait.
MultiForkByErrorProvider does not support forking between DataProviders. However, it
supports forking between AnyProvider, BufferProvider, and DynamicDataProvider.
Fields§
§providers: Vec<P>§predicate: FImplementations§
Source§impl<P, F> MultiForkByErrorProvider<P, F>
 
impl<P, F> MultiForkByErrorProvider<P, F>
Sourcepub fn new_with_predicate(providers: Vec<P>, predicate: F) -> Self
 
pub fn new_with_predicate(providers: Vec<P>, predicate: F) -> Self
Create a new provider that forks between the vector of children.
The predicate argument should be an instance of a struct implementing
ForkByErrorPredicate.
Sourcepub fn with_inner_mut(&mut self, f: impl FnOnce(&mut Vec<P>))
 
pub fn with_inner_mut(&mut self, f: impl FnOnce(&mut Vec<P>))
Exposes a mutable vector of providers to a closure so it can be mutated.
Sourcepub fn into_inner(self) -> Vec<P>
 
pub fn into_inner(self) -> Vec<P>
Returns ownership of the inner providers to the caller.
Source§impl<P> MultiForkByErrorProvider<P, MissingDataKeyPredicate>
 
impl<P> MultiForkByErrorProvider<P, MissingDataKeyPredicate>
Trait Implementations§
Source§impl<P, F> AnyProvider for MultiForkByErrorProvider<P, F>where
    P: AnyProvider,
    F: ForkByErrorPredicate,
 
impl<P, F> AnyProvider for MultiForkByErrorProvider<P, F>where
    P: AnyProvider,
    F: ForkByErrorPredicate,
Source§fn load_any(
    &self,
    key: DataKey,
    req: DataRequest<'_>,
) -> Result<AnyResponse, DataError>
 
fn load_any( &self, key: DataKey, req: DataRequest<'_>, ) -> Result<AnyResponse, DataError>
Loads an 
AnyPayload according to the key and request.Source§impl<P, F> BufferProvider for MultiForkByErrorProvider<P, F>where
    P: BufferProvider,
    F: ForkByErrorPredicate,
 
impl<P, F> BufferProvider for MultiForkByErrorProvider<P, F>where
    P: BufferProvider,
    F: ForkByErrorPredicate,
Source§fn load_buffer(
    &self,
    key: DataKey,
    req: DataRequest<'_>,
) -> Result<DataResponse<BufferMarker>, DataError>
 
fn load_buffer( &self, key: DataKey, req: DataRequest<'_>, ) -> Result<DataResponse<BufferMarker>, DataError>
Source§impl<M, P, F> DynamicDataProvider<M> for MultiForkByErrorProvider<P, F>
 
impl<M, P, F> DynamicDataProvider<M> for MultiForkByErrorProvider<P, F>
Source§fn load_data(
    &self,
    key: DataKey,
    req: DataRequest<'_>,
) -> Result<DataResponse<M>, DataError>
 
fn load_data( &self, key: DataKey, req: DataRequest<'_>, ) -> Result<DataResponse<M>, DataError>
Query the provider for data, returning the result. Read more
Auto Trait Implementations§
impl<P, F> Freeze for MultiForkByErrorProvider<P, F>where
    F: Freeze,
impl<P, F> RefUnwindSafe for MultiForkByErrorProvider<P, F>where
    F: RefUnwindSafe,
    P: RefUnwindSafe,
impl<P, F> Send for MultiForkByErrorProvider<P, F>
impl<P, F> Sync for MultiForkByErrorProvider<P, F>
impl<P, F> Unpin for MultiForkByErrorProvider<P, F>
impl<P, F> UnwindSafe for MultiForkByErrorProvider<P, F>where
    F: UnwindSafe,
    P: UnwindSafe,
Blanket Implementations§
Source§impl<P> AsDowncastingAnyProvider for Pwhere
    P: AnyProvider + ?Sized,
 
impl<P> AsDowncastingAnyProvider for Pwhere
    P: AnyProvider + ?Sized,
Source§fn as_downcasting(&self) -> DowncastingAnyProvider<'_, P>
 
fn as_downcasting(&self) -> DowncastingAnyProvider<'_, P>
Returns an object implementing 
DynamicDataProvider<M> when called on AnyProviderSource§impl<P> AsDynamicDataProviderAnyMarkerWrap for P
 
impl<P> AsDynamicDataProviderAnyMarkerWrap for P
Source§fn as_any_provider(&self) -> DynamicDataProviderAnyMarkerWrap<'_, P>
 
fn as_any_provider(&self) -> DynamicDataProviderAnyMarkerWrap<'_, P>
Returns an object implementing 
AnyProvider when called on DynamicDataProvider<AnyMarker>Source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Filterable for T
 
impl<T> Filterable for T
Source§fn filterable(
    self,
    filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
 
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. Read more