pub struct ICU4XDataProvider(pub ICU4XDataProviderInner);Expand description
An ICU4X data provider, capable of loading ICU4X data keys from some source.
Tuple Fields§
§0: ICU4XDataProviderInnerImplementations§
Source§impl ICU4XDataProvider
impl ICU4XDataProvider
Sourcepub fn create_compiled() -> Box<ICU4XDataProvider>
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.
Sourcepub fn create_empty() -> Box<ICU4XDataProvider>
pub fn create_empty() -> Box<ICU4XDataProvider>
Constructs an empty ICU4XDataProvider.
Sourcepub fn fork_by_key(
&mut self,
other: &mut ICU4XDataProvider,
) -> Result<(), ICU4XError>
pub fn fork_by_key( &mut self, other: &mut ICU4XDataProvider, ) -> Result<(), ICU4XError>
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.
Sourcepub fn fork_by_locale(
&mut self,
other: &mut ICU4XDataProvider,
) -> Result<(), ICU4XError>
pub fn fork_by_locale( &mut self, other: &mut ICU4XDataProvider, ) -> Result<(), ICU4XError>
Same as fork_by_key but forks by locale instead of key.
Sourcepub fn enable_locale_fallback(&mut self) -> Result<(), ICU4XError>
pub fn enable_locale_fallback(&mut self) -> Result<(), ICU4XError>
Enables locale fallbacking for data requests made to this provider.
Note that the test provider (from create_test) already has fallbacking enabled.
Auto Trait Implementations§
impl Freeze for ICU4XDataProvider
impl RefUnwindSafe for ICU4XDataProvider
impl Send for ICU4XDataProvider
impl Sync for ICU4XDataProvider
impl Unpin for ICU4XDataProvider
impl UnwindSafe for ICU4XDataProvider
Blanket Implementations§
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
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>
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 1 byte