Struct icu_provider_adapters::fork::ForkByErrorProvider

source ·
pub struct ForkByErrorProvider<P0, P1, F>(P0, P1, F);
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 DataProviders. However, it supports forking between AnyProvider, BufferProvider, and DynamicDataProvider.

Tuple Fields§

§0: P0§1: P1§2: F

Implementations§

source§

impl<P0, P1, F> ForkByErrorProvider<P0, P1, F>

source

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.

source

pub fn inner(&self) -> (&P0, &P1)

Returns references to the inner providers.

source

pub fn inner_mut(&mut self) -> (&mut P0, &mut P1)

Returns mutable references to the inner providers.

source

pub fn into_inner(self) -> (P0, P1)

Returns ownership of the inner providers to the caller.

source§

impl<P0, P1> ForkByErrorProvider<P0, P1, MissingDataKeyPredicate>

source

pub fn new(p0: P0, p1: P1) -> Self

A provider that returns data from one of two child providers based on the key.

See ForkByKeyProvider.

Trait Implementations§

source§

impl<P0, P1, F> AnyProvider for ForkByErrorProvider<P0, P1, F>

source§

fn load_any( &self, key: DataKey, req: DataRequest<'_>, ) -> Result<AnyResponse, DataError>

Loads an AnyPayload according to the key and request.
source§

impl<P0, P1, F> BufferProvider for ForkByErrorProvider<P0, P1, F>

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<P0: Debug, P1: Debug, F: Debug> Debug for ForkByErrorProvider<P0, P1, F>

source§

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

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

impl<M, P0, P1, F> DynamicDataProvider<M> for ForkByErrorProvider<P0, P1, F>

source§

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

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

impl<P0: PartialEq, P1: PartialEq, F: PartialEq> PartialEq for ForkByErrorProvider<P0, P1, F>

source§

fn eq(&self, other: &ForkByErrorProvider<P0, P1, F>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<P0: Eq, P1: Eq, F: Eq> Eq for ForkByErrorProvider<P0, P1, F>

source§

impl<P0, P1, F> StructuralPartialEq for ForkByErrorProvider<P0, P1, F>

Auto Trait Implementations§

§

impl<P0, P1, F> Freeze for ForkByErrorProvider<P0, P1, F>
where P0: Freeze, P1: Freeze, F: Freeze,

§

impl<P0, P1, F> RefUnwindSafe for ForkByErrorProvider<P0, P1, F>

§

impl<P0, P1, F> Send for ForkByErrorProvider<P0, P1, F>
where P0: Send, P1: Send, F: Send,

§

impl<P0, P1, F> Sync for ForkByErrorProvider<P0, P1, F>
where P0: Sync, P1: Sync, F: Sync,

§

impl<P0, P1, F> Unpin for ForkByErrorProvider<P0, P1, F>
where P0: Unpin, P1: Unpin, F: Unpin,

§

impl<P0, P1, F> UnwindSafe for ForkByErrorProvider<P0, P1, F>
where P0: UnwindSafe, P1: UnwindSafe, F: 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