class ICU4XDataProvider; #include"ICU4XError.hpp" class ICU4XLocaleFallbacker;
/** * A destruction policy for using ICU4XDataProvider with std::unique_ptr.
*/ struct ICU4XDataProviderDeleter { voidoperator()(capi::ICU4XDataProvider* l) const noexcept {
capi::ICU4XDataProvider_destroy(l);
}
};
/** * An ICU4X data provider, capable of loading ICU4X data keys from some source. * * See the [Rust documentation for `icu_provider`](https://docs.rs/icu_provider/latest/icu_provider/index.html) for more information.
*/ class ICU4XDataProvider { public:
/** * 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.
*/ static ICU4XDataProvider create_compiled();
/** * 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`](https://docs.rs/icu_provider_fs/latest/icu_provider_fs/struct.FsDataProvider.html) for more information.
*/ static diplomat::result<ICU4XDataProvider, ICU4XError> create_fs(const std::string_view path);
/** * Constructs a `BlobDataProvider` and returns it as an [`ICU4XDataProvider`]. * * See the [Rust documentation for `BlobDataProvider`](https://docs.rs/icu_provider_blob/latest/icu_provider_blob/struct.BlobDataProvider.html) for more information. * * Lifetimes: `blob` must live for the duration of the program.
*/ static diplomat::result<ICU4XDataProvider, ICU4XError> create_from_byte_slice(const diplomat::span<const uint8_t> blob);
/** * 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`](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fork/type.ForkByKeyProvider.html) for more information.
*/
diplomat::result<std::monostate, ICU4XError> fork_by_key(ICU4XDataProvider& other);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.