Struct icu_provider_adapters::fork::ForkByErrorProvider
source · pub struct ForkByErrorProvider<P0, P1, F>(/* private fields */);
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 [DataProvider
]s. However, it
supports forking between [AnyProvider
], [BufferProvider
], and [DynamicDataProvider
].
Implementations§
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<P0, P1, F> AnyProvider for ForkByErrorProvider<P0, P1, F>where
P0: AnyProvider,
P1: AnyProvider,
F: ForkByErrorPredicate,
impl<P0, P1, F> AnyProvider for ForkByErrorProvider<P0, P1, F>where
P0: AnyProvider,
P1: AnyProvider,
F: ForkByErrorPredicate,
source§impl<M, P0, P1, F> DataProvider<M> for ForkByErrorProvider<P0, P1, F>where
M: DataMarker,
P0: DataProvider<M>,
P1: DataProvider<M>,
F: ForkByErrorPredicate,
impl<M, P0, P1, F> DataProvider<M> for ForkByErrorProvider<P0, P1, F>where
M: DataMarker,
P0: DataProvider<M>,
P1: DataProvider<M>,
F: ForkByErrorPredicate,
source§impl<M, P0, P1, F> DryDataProvider<M> for ForkByErrorProvider<P0, P1, F>where
M: DataMarker,
P0: DryDataProvider<M>,
P1: DryDataProvider<M>,
F: ForkByErrorPredicate,
impl<M, P0, P1, F> DryDataProvider<M> for ForkByErrorProvider<P0, P1, F>where
M: DataMarker,
P0: DryDataProvider<M>,
P1: DryDataProvider<M>,
F: ForkByErrorPredicate,
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§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§impl<P0, P1, F> ExportableProvider for ForkByErrorProvider<P0, P1, F>where
P0: ExportableProvider,
P1: ExportableProvider,
F: ForkByErrorPredicate + Sync,
impl<P0, P1, F> ExportableProvider for ForkByErrorProvider<P0, P1, F>where
P0: ExportableProvider,
P1: ExportableProvider,
F: ForkByErrorPredicate + Sync,
source§fn supported_markers(&self) -> HashSet<DataMarkerInfo>
fn supported_markers(&self) -> HashSet<DataMarkerInfo>
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>
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
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> UnwindSafe for ForkByErrorProvider<P0, P1, F>
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