pub struct ForkByErrorProvider<P0, P1, F>(P0, P1, F);Expand description
A provider that returns data from one of two child providers based on a predicate function.
This is an abstract forking provider that must be provided with a type implementing the
ForkByErrorPredicate trait.
ForkByErrorProvider does not support forking between DataProviders. However, it
supports forking between BufferProvider, and DynamicDataProvider.
Tuple Fields§
§0: P0§1: P1§2: FImplementations§
Source§impl<P0, P1, F> ForkByErrorProvider<P0, P1, F>
impl<P0, P1, F> ForkByErrorProvider<P0, P1, F>
Sourcepub fn new_with_predicate(p0: P0, p1: P1, predicate: F) -> Self
pub fn new_with_predicate(p0: P0, p1: P1, predicate: F) -> Self
Create a new provider that forks between the two children.
The predicate argument should be an instance of a struct implementing
ForkByErrorPredicate.
Sourcepub fn inner_mut(&mut self) -> (&mut P0, &mut P1)
pub fn inner_mut(&mut self) -> (&mut P0, &mut P1)
Returns mutable references to the inner providers.
Sourcepub fn into_inner(self) -> (P0, P1)
pub fn into_inner(self) -> (P0, P1)
Returns ownership of the inner providers to the caller.
Source§impl<P0, P1> ForkByErrorProvider<P0, P1, MarkerNotFoundPredicate>
impl<P0, P1> ForkByErrorProvider<P0, P1, MarkerNotFoundPredicate>
Sourcepub fn new(p0: P0, p1: P1) -> Self
pub fn new(p0: P0, p1: P1) -> Self
A provider that returns data from one of two child providers based on the marker.
See ForkByMarkerProvider.
Trait Implementations§
Source§impl<M, P0, P1, F> DataProvider<M> for ForkByErrorProvider<P0, P1, F>
impl<M, P0, P1, F> DataProvider<M> for ForkByErrorProvider<P0, P1, 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, P0, P1, F> DryDataProvider<M> for ForkByErrorProvider<P0, P1, F>
impl<M, P0, P1, F> DryDataProvider<M> for ForkByErrorProvider<P0, P1, F>
Source§fn dry_load(
&self,
req: DataRequest<'_>,
) -> Result<DataResponseMetadata, DataError>
fn dry_load( &self, req: DataRequest<'_>, ) -> Result<DataResponseMetadata, DataError>
Source§impl<M, P0, P1, F> DynamicDataProvider<M> for ForkByErrorProvider<P0, P1, F>where
M: DynamicDataMarker,
P0: DynamicDataProvider<M>,
P1: DynamicDataProvider<M>,
F: ForkByErrorPredicate,
impl<M, P0, P1, F> DynamicDataProvider<M> for ForkByErrorProvider<P0, P1, F>where
M: DynamicDataMarker,
P0: DynamicDataProvider<M>,
P1: DynamicDataProvider<M>,
F: ForkByErrorPredicate,
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, P0, P1, F> DynamicDryDataProvider<M> for ForkByErrorProvider<P0, P1, F>where
M: DynamicDataMarker,
P0: DynamicDryDataProvider<M>,
P1: DynamicDryDataProvider<M>,
F: ForkByErrorPredicate,
impl<M, P0, P1, F> DynamicDryDataProvider<M> for ForkByErrorProvider<P0, P1, F>where
M: DynamicDataMarker,
P0: DynamicDryDataProvider<M>,
P1: DynamicDryDataProvider<M>,
F: ForkByErrorPredicate,
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, P0, P1, F> IterableDynamicDataProvider<M> for ForkByErrorProvider<P0, P1, F>where
M: DynamicDataMarker,
P0: IterableDynamicDataProvider<M>,
P1: IterableDynamicDataProvider<M>,
F: ForkByErrorPredicate,
impl<M, P0, P1, F> IterableDynamicDataProvider<M> for ForkByErrorProvider<P0, P1, F>where
M: DynamicDataMarker,
P0: IterableDynamicDataProvider<M>,
P1: IterableDynamicDataProvider<M>,
F: ForkByErrorPredicate,
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.Source§impl<P0: PartialEq, P1: PartialEq, F: PartialEq> PartialEq for ForkByErrorProvider<P0, P1, F>
impl<P0: PartialEq, P1: PartialEq, F: PartialEq> PartialEq for ForkByErrorProvider<P0, P1, F>
Source§fn eq(&self, other: &ForkByErrorProvider<P0, P1, F>) -> bool
fn eq(&self, other: &ForkByErrorProvider<P0, P1, F>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<P0: Eq, P1: Eq, F: Eq> Eq for ForkByErrorProvider<P0, P1, F>
impl<P0, P1, F> StructuralPartialEq for ForkByErrorProvider<P0, P1, F>
Auto Trait Implementations§
impl<P0, P1, F> Freeze for ForkByErrorProvider<P0, P1, F>
impl<P0, P1, F> RefUnwindSafe for ForkByErrorProvider<P0, P1, F>
impl<P0, P1, F> Send for ForkByErrorProvider<P0, P1, F>
impl<P0, P1, F> Sync for ForkByErrorProvider<P0, P1, F>
impl<P0, P1, F> Unpin for ForkByErrorProvider<P0, P1, F>
impl<P0, P1, F> UnsafeUnpin for ForkByErrorProvider<P0, P1, F>
impl<P0, P1, F> UnwindSafe for ForkByErrorProvider<P0, P1, F>
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