Skip to main content

EitherProvider

Enum EitherProvider 

Source
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§

§

A(P0)

A value of type P0.

§

B(P1)

A value of type P1.

Trait Implementations§

Source§

impl<M: DataMarker, P0: DataProvider<M>, P1: DataProvider<M>> DataProvider<M> for EitherProvider<P0, P1>

Source§

fn load(&self, req: DataRequest<'_>) -> Result<DataResponse<M>, DataError>

Query the provider for data, returning the result. Read more
Source§

impl<P0: Debug, P1: Debug> Debug for EitherProvider<P0, P1>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<M: DataMarker, P0: DryDataProvider<M>, P1: DryDataProvider<M>> DryDataProvider<M> for EitherProvider<P0, P1>

Source§

fn dry_load( &self, req: DataRequest<'_>, ) -> Result<DataResponseMetadata, DataError>

This method goes through the motions of load, but only returns the metadata. Read more
Source§

impl<M: DynamicDataMarker, P0: DynamicDataProvider<M>, P1: DynamicDataProvider<M>> DynamicDataProvider<M> for EitherProvider<P0, P1>

Source§

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: DynamicDataMarker, P0: DynamicDryDataProvider<M>, P1: DynamicDryDataProvider<M>> DynamicDryDataProvider<M> for EitherProvider<P0, P1>

Source§

fn dry_load_data( &self, marker: DataMarkerInfo, req: DataRequest<'_>, ) -> Result<DataResponseMetadata, DataError>

This method goes through the motions of load_data, but only returns the metadata. Read more
Source§

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>

Auto Trait Implementations§

§

impl<P0, P1> Freeze for EitherProvider<P0, P1>
where P0: Freeze, P1: Freeze,

§

impl<P0, P1> RefUnwindSafe for EitherProvider<P0, P1>

§

impl<P0, P1> Send for EitherProvider<P0, P1>
where P0: Send, P1: Send,

§

impl<P0, P1> Sync for EitherProvider<P0, P1>
where P0: Sync, P1: Sync,

§

impl<P0, P1> Unpin for EitherProvider<P0, P1>
where P0: Unpin, P1: Unpin,

§

impl<P0, P1> UnsafeUnpin for EitherProvider<P0, P1>
where P0: UnsafeUnpin, P1: UnsafeUnpin,

§

impl<P0, P1> UnwindSafe for EitherProvider<P0, P1>
where P0: UnwindSafe, P1: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<P> BufferProvider for P

Source§

impl<T> ErasedDestructor for T
where T: 'static,