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 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, MarkerNotFoundPredicate>
impl<P> MultiForkByErrorProvider<P, MarkerNotFoundPredicate>
Trait Implementations§
Source§impl<M, P, F> DataProvider<M> for MultiForkByErrorProvider<P, F>
impl<M, P, F> DataProvider<M> for MultiForkByErrorProvider<P, F>
Source§fn load(&self, req: DataRequest<'_>) -> Result<DataResponse<M>, DataError>
fn load(&self, req: DataRequest<'_>) -> Result<DataResponse<M>, DataError>
Query the provider for data, returning the result. Read more
Source§impl<M, P, F> DryDataProvider<M> for MultiForkByErrorProvider<P, F>
impl<M, P, F> DryDataProvider<M> for MultiForkByErrorProvider<P, F>
Source§fn dry_load(
&self,
req: DataRequest<'_>,
) -> Result<DataResponseMetadata, DataError>
fn dry_load( &self, req: DataRequest<'_>, ) -> Result<DataResponseMetadata, 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,
marker: DataMarkerInfo,
req: DataRequest<'_>,
) -> Result<DataResponse<M>, DataError>
fn load_data( &self, marker: DataMarkerInfo, req: DataRequest<'_>, ) -> Result<DataResponse<M>, DataError>
Query the provider for data, returning the result. Read more
Source§impl<M, P, F> DynamicDryDataProvider<M> for MultiForkByErrorProvider<P, F>
impl<M, P, F> DynamicDryDataProvider<M> for MultiForkByErrorProvider<P, F>
Source§fn dry_load_data(
&self,
marker: DataMarkerInfo,
req: DataRequest<'_>,
) -> Result<DataResponseMetadata, DataError>
fn dry_load_data( &self, marker: DataMarkerInfo, req: DataRequest<'_>, ) -> Result<DataResponseMetadata, DataError>
Source§impl<M, P, F> IterableDynamicDataProvider<M> for MultiForkByErrorProvider<P, F>
impl<M, P, F> IterableDynamicDataProvider<M> for MultiForkByErrorProvider<P, F>
Source§fn iter_ids_for_marker(
&self,
marker: DataMarkerInfo,
) -> Result<BTreeSet<DataIdentifierCow<'_>>, DataError>
fn iter_ids_for_marker( &self, marker: DataMarkerInfo, ) -> Result<BTreeSet<DataIdentifierCow<'_>>, DataError>
Given a
DataMarkerInfo, returns a set of DataIdentifierCow.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> UnsafeUnpin for MultiForkByErrorProvider<P, F>where
F: UnsafeUnpin,
impl<P, F> UnwindSafe for MultiForkByErrorProvider<P, F>where
F: UnwindSafe,
P: UnwindSafe,
Blanket Implementations§
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