pub struct ICU4XDataProvider(pub ICU4XDataProviderInner);
Expand description

An ICU4X data provider, capable of loading ICU4X data keys from some source.

Tuple Fields§

§0: ICU4XDataProviderInner

Implementations§

source§

impl ICU4XDataProvider

source

pub fn create_compiled() -> Box<ICU4XDataProvider>

Constructs an ICU4XDataProvider that uses compiled data.

Requires the compiled_data feature.

This provider cannot be modified or combined with other providers, so enable_fallback, enabled_fallback_with, fork_by_locale, and fork_by_key will return Errs.

source

pub fn create_fs( path: &DiplomatStr ) -> Result<Box<ICU4XDataProvider>, ICU4XDataError>

Constructs an FsDataProvider and returns it as an ICU4XDataProvider. Requires the provider_fs Cargo feature. Not supported in WASM.

source

pub fn create_from_byte_slice( blob: &'static [DiplomatByte] ) -> Result<Box<ICU4XDataProvider>, ICU4XDataError>

Constructs a BlobDataProvider and returns it as an ICU4XDataProvider.

source

pub fn create_empty() -> Box<ICU4XDataProvider>

Constructs an empty ICU4XDataProvider.

source

pub fn fork_by_key( &mut self, other: &mut ICU4XDataProvider ) -> Result<(), ICU4XDataError>

Creates a provider that tries the current provider and then, if the current provider doesn’t support the data key, another provider other.

This takes ownership of the other provider, leaving an empty provider in its place.

The providers must be the same type (Any or Buffer). This condition is satisfied if both providers originate from the same constructor, such as create_from_byte_slice or create_fs. If the condition is not upheld, a runtime error occurs.

source

pub fn fork_by_locale( &mut self, other: &mut ICU4XDataProvider ) -> Result<(), ICU4XDataError>

Same as fork_by_key but forks by locale instead of key.

source

pub fn enable_locale_fallback_with( &mut self, fallbacker: &ICU4XLocaleFallbacker ) -> Result<(), ICU4XDataError>

Auto Trait Implementations§

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> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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