ICU4X
International Components for Unicode
|
#include <ICU4XDataProvider.hpp>
Public Member Functions | |
diplomat::result< std::monostate, ICU4XError > | fork_by_key (ICU4XDataProvider &other) |
diplomat::result< std::monostate, ICU4XError > | fork_by_locale (ICU4XDataProvider &other) |
diplomat::result< std::monostate, ICU4XError > | enable_locale_fallback () |
diplomat::result< std::monostate, ICU4XError > | enable_locale_fallback_with (const ICU4XLocaleFallbacker &fallbacker) |
ICU4XDataProvider (capi::ICU4XDataProvider *i) | |
ICU4XDataProvider ()=default | |
ICU4XDataProvider (ICU4XDataProvider &&) noexcept=default | |
ICU4XDataProvider & | operator= (ICU4XDataProvider &&other) noexcept=default |
Static Public Member Functions | |
static ICU4XDataProvider | create_compiled () |
static diplomat::result< ICU4XDataProvider, ICU4XError > | create_fs (const std::string_view path) |
static ICU4XDataProvider | create_test () |
static diplomat::result< ICU4XDataProvider, ICU4XError > | create_from_byte_slice (const diplomat::span< const uint8_t > blob) |
static ICU4XDataProvider | create_empty () |
An ICU4X data provider, capable of loading ICU4X data keys from some source.
See the Rust documentation for icu_provider
for more information.
|
inlineexplicit |
|
default |
|
defaultnoexcept |
|
inlinestatic |
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 Err
s.
|
inlinestatic |
Constructs an empty [ICU4XDataProvider
].
See the Rust documentation for EmptyDataProvider
for more information.
|
inlinestatic |
Constructs a BlobDataProvider
and returns it as an [ICU4XDataProvider
].
See the Rust documentation for BlobDataProvider
for more information.
Lifetimes: blob
must live for the duration of the program.
|
inlinestatic |
Constructs an FsDataProvider
and returns it as an [ICU4XDataProvider
]. Requires the provider_fs
Cargo feature. Not supported in WASM.
See the Rust documentation for FsDataProvider
for more information.
|
inlinestatic |
Deprecated
Use create_compiled()
.
|
inline |
Enables locale fallbacking for data requests made to this provider.
Note that the test provider (from create_test
) already has fallbacking enabled.
See the Rust documentation for try_new
for more information.
Additional information: 1
|
inline |
See the Rust documentation for new_with_fallbacker
for more information.
Additional information: 1
|
inline |
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.
See the Rust documentation for ForkByKeyProvider
for more information.
|
inline |
Same as fork_by_key
but forks by locale instead of key.
See the Rust documentation for MissingLocalePredicate
for more information.
|
defaultnoexcept |