pub struct MultiForkByErrorProvider<P, F> { /* private fields */ }
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 [DataProvider
]s. However, it
supports forking between [AnyProvider
], [BufferProvider
], and [DynamicDataProvider
].
Implementations§
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<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§impl<M, P, F> DataProvider<M> for MultiForkByErrorProvider<P, F>where
M: DataMarker,
P: DataProvider<M>,
F: ForkByErrorPredicate,
impl<M, P, F> DataProvider<M> for MultiForkByErrorProvider<P, F>where
M: DataMarker,
P: DataProvider<M>,
F: ForkByErrorPredicate,
source§impl<M, P, F> DryDataProvider<M> for MultiForkByErrorProvider<P, F>where
M: DataMarker,
P: DryDataProvider<M>,
F: ForkByErrorPredicate,
impl<M, P, F> DryDataProvider<M> for MultiForkByErrorProvider<P, F>where
M: DataMarker,
P: DryDataProvider<M>,
F: ForkByErrorPredicate,
source§impl<M, P, F> DynamicDataProvider<M> for MultiForkByErrorProvider<P, F>where
M: DynamicDataMarker,
P: DynamicDataProvider<M>,
F: ForkByErrorPredicate,
impl<M, P, F> DynamicDataProvider<M> for MultiForkByErrorProvider<P, F>where
M: DynamicDataMarker,
P: DynamicDataProvider<M>,
F: ForkByErrorPredicate,
source§impl<M, P, F> DynamicDryDataProvider<M> for MultiForkByErrorProvider<P, F>where
M: DynamicDataMarker,
P: DynamicDryDataProvider<M>,
F: ForkByErrorPredicate,
impl<M, P, F> DynamicDryDataProvider<M> for MultiForkByErrorProvider<P, F>where
M: DynamicDataMarker,
P: DynamicDryDataProvider<M>,
F: ForkByErrorPredicate,
source§impl<P, F> ExportableProvider for MultiForkByErrorProvider<P, F>where
P: ExportableProvider,
F: ForkByErrorPredicate + Sync,
impl<P, F> ExportableProvider for MultiForkByErrorProvider<P, F>where
P: ExportableProvider,
F: ForkByErrorPredicate + Sync,
source§fn supported_markers(&self) -> HashSet<DataMarkerInfo>
fn supported_markers(&self) -> HashSet<DataMarkerInfo>
source§impl<M, P, F> IterableDynamicDataProvider<M> for MultiForkByErrorProvider<P, F>where
M: DynamicDataMarker,
P: IterableDynamicDataProvider<M>,
F: ForkByErrorPredicate,
impl<M, P, F> IterableDynamicDataProvider<M> for MultiForkByErrorProvider<P, F>where
M: DynamicDataMarker,
P: 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>
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> UnwindSafe for MultiForkByErrorProvider<P, F>where
F: UnwindSafe,
P: UnwindSafe,
Blanket Implementations§
§impl<P> AsDeserializingBufferProvider for Pwhere
P: BufferProvider + ?Sized,
impl<P> AsDeserializingBufferProvider for Pwhere
P: BufferProvider + ?Sized,
§fn as_deserializing(&self) -> DeserializingBufferProvider<'_, P>
fn as_deserializing(&self) -> DeserializingBufferProvider<'_, P>
Wrap this [BufferProvider
] in a [DeserializingBufferProvider
].
This requires enabling the deserialization Cargo feature for the expected format(s):
deserialize_json
deserialize_postcard_1
deserialize_bincode_1
§impl<P> AsDowncastingAnyProvider for Pwhere
P: AnyProvider + ?Sized,
impl<P> AsDowncastingAnyProvider for Pwhere
P: AnyProvider + ?Sized,
§fn as_downcasting(&self) -> DowncastingAnyProvider<'_, P>
fn as_downcasting(&self) -> DowncastingAnyProvider<'_, P>
DynamicDataProvider<M>
when called on AnyProvider
§impl<P> AsDynamicDataProviderAnyMarkerWrap for Pwhere
P: DynamicDataProvider<AnyMarker> + ?Sized,
impl<P> AsDynamicDataProviderAnyMarkerWrap for Pwhere
P: DynamicDataProvider<AnyMarker> + ?Sized,
§fn as_any_provider(&self) -> DynamicDataProviderAnyMarkerWrap<'_, P>
fn as_any_provider(&self) -> DynamicDataProviderAnyMarkerWrap<'_, P>
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more