Enum icu_provider_adapters::either::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<P0: AnyProvider, P1: AnyProvider> AnyProvider for EitherProvider<P0, P1>

source§

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>

source§

fn load_buffer( &self, key: DataKey, req: DataRequest<'_>, ) -> Result<DataResponse<BufferMarker>, DataError>

Loads a DataPayload<BufferMarker> according to the key and request.
source§

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>

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

source§

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>
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> 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<P> AsDowncastingAnyProvider for P
where P: AnyProvider + ?Sized,

source§

fn as_downcasting(&self) -> DowncastingAnyProvider<'_, P>

Returns an object implementing DynamicDataProvider<M> when called on AnyProvider
source§

impl<P> AsDynamicDataProviderAnyMarkerWrap for P

source§

fn as_any_provider(&self) -> DynamicDataProviderAnyMarkerWrap<'_, P>

Returns an object implementing AnyProvider when called on DynamicDataProvider<AnyMarker>
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> Filterable for T

source§

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
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>,

§

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>,

§

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<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T