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§fn load_any(
&self,
key: DataKey,
req: DataRequest<'_>,
) -> Result<AnyResponse, DataError>
fn load_any( &self, key: DataKey, req: DataRequest<'_>, ) -> Result<AnyResponse, DataError>
Loads an
AnyPayload
according to the key and request.source§impl<P0: BufferProvider, P1: BufferProvider> BufferProvider for EitherProvider<P0, P1>
impl<P0: BufferProvider, P1: BufferProvider> BufferProvider for EitherProvider<P0, P1>
source§fn load_buffer(
&self,
key: DataKey,
req: DataRequest<'_>,
) -> Result<DataResponse<BufferMarker>, DataError>
fn load_buffer( &self, key: DataKey, req: DataRequest<'_>, ) -> Result<DataResponse<BufferMarker>, DataError>
source§impl<M: KeyedDataMarker, P0: DataProvider<M>, P1: DataProvider<M>> DataProvider<M> for EitherProvider<P0, P1>
impl<M: KeyedDataMarker, P0: DataProvider<M>, P1: DataProvider<M>> DataProvider<M> for EitherProvider<P0, P1>
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: DataMarker, P0: DynamicDataProvider<M>, P1: DynamicDataProvider<M>> DynamicDataProvider<M> for EitherProvider<P0, P1>
impl<M: DataMarker, P0: DynamicDataProvider<M>, P1: DynamicDataProvider<M>> DynamicDataProvider<M> for EitherProvider<P0, P1>
source§fn load_data(
&self,
key: DataKey,
req: DataRequest<'_>,
) -> Result<DataResponse<M>, DataError>
fn load_data( &self, key: DataKey, req: DataRequest<'_>, ) -> Result<DataResponse<M>, DataError>
Query the provider for data, returning the result. Read more
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§
source§impl<P> AsDowncastingAnyProvider for Pwhere
P: AnyProvider + ?Sized,
impl<P> AsDowncastingAnyProvider for Pwhere
P: AnyProvider + ?Sized,
source§fn as_downcasting(&self) -> DowncastingAnyProvider<'_, P>
fn as_downcasting(&self) -> DowncastingAnyProvider<'_, P>
Returns an object implementing
DynamicDataProvider<M>
when called on AnyProvider
source§impl<P> AsDynamicDataProviderAnyMarkerWrap for P
impl<P> AsDynamicDataProviderAnyMarkerWrap for P
source§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> Filterable for T
impl<T> Filterable for T
source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. Read more