pub enum EitherProvider<P0, P1> {
A(P0),
B(P1),
}
Expand description
A provider that is one of two types determined at runtime.
Data provider traits implemented by both P0
and P1
are implemented on
EitherProvider<P0, P1>
.
Variants§
Trait Implementations§
source§impl<P0: AnyProvider, P1: AnyProvider> AnyProvider for EitherProvider<P0, P1>
impl<P0: AnyProvider, P1: AnyProvider> AnyProvider for EitherProvider<P0, P1>
source§impl<M: DataMarker, P0: DataProvider<M>, P1: DataProvider<M>> DataProvider<M> for EitherProvider<P0, P1>
impl<M: DataMarker, P0: DataProvider<M>, P1: DataProvider<M>> DataProvider<M> for EitherProvider<P0, P1>
source§impl<M: DataMarker, P0: DryDataProvider<M>, P1: DryDataProvider<M>> DryDataProvider<M> for EitherProvider<P0, P1>
impl<M: DataMarker, P0: DryDataProvider<M>, P1: DryDataProvider<M>> DryDataProvider<M> for EitherProvider<P0, P1>
source§impl<M: DynamicDataMarker, P0: DynamicDataProvider<M>, P1: DynamicDataProvider<M>> DynamicDataProvider<M> for EitherProvider<P0, P1>
impl<M: DynamicDataMarker, P0: DynamicDataProvider<M>, P1: DynamicDataProvider<M>> DynamicDataProvider<M> for EitherProvider<P0, P1>
source§impl<M: DynamicDataMarker, P0: DynamicDryDataProvider<M>, P1: DynamicDryDataProvider<M>> DynamicDryDataProvider<M> for EitherProvider<P0, P1>
impl<M: DynamicDataMarker, P0: DynamicDryDataProvider<M>, P1: DynamicDryDataProvider<M>> DynamicDryDataProvider<M> for EitherProvider<P0, P1>
source§impl<P0, P1> ExportableProvider for EitherProvider<P0, P1>where
P0: ExportableProvider,
P1: ExportableProvider,
impl<P0, P1> ExportableProvider for EitherProvider<P0, P1>where
P0: ExportableProvider,
P1: ExportableProvider,
source§fn supported_markers(&self) -> HashSet<DataMarkerInfo>
fn supported_markers(&self) -> HashSet<DataMarkerInfo>
Returns the set of supported markers
source§impl<M: DataMarker, P0: IterableDataProvider<M>, P1: IterableDataProvider<M>> IterableDataProvider<M> for EitherProvider<P0, P1>
impl<M: DataMarker, P0: IterableDataProvider<M>, P1: IterableDataProvider<M>> IterableDataProvider<M> for EitherProvider<P0, P1>
source§impl<M: DynamicDataMarker, P0: IterableDynamicDataProvider<M>, P1: IterableDynamicDataProvider<M>> IterableDynamicDataProvider<M> for EitherProvider<P0, P1>
impl<M: DynamicDataMarker, P0: IterableDynamicDataProvider<M>, P1: IterableDynamicDataProvider<M>> IterableDynamicDataProvider<M> for EitherProvider<P0, P1>
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<P0, P1> Freeze for EitherProvider<P0, P1>
impl<P0, P1> RefUnwindSafe for EitherProvider<P0, P1>where
P0: RefUnwindSafe,
P1: RefUnwindSafe,
impl<P0, P1> Send for EitherProvider<P0, P1>
impl<P0, P1> Sync for EitherProvider<P0, P1>
impl<P0, P1> Unpin for EitherProvider<P0, P1>
impl<P0, P1> UnwindSafe for EitherProvider<P0, P1>where
P0: UnwindSafe,
P1: 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>
Returns an object implementing
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>
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> 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>
Converts
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>
Converts
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