Struct icu_provider::inv::InvariantDataProvider [−][src]
pub struct InvariantDataProvider;
Expand description
A locale-invariant data provider. Sometimes useful for testing. Not intended to be used in production environments.
The objects returned by InvariantDataProvider
are guaranteed to conform to the correct struct
definition, so InvariantDataProvider
can also be used to validate unknown data providers.
Examples
use icu_provider::prelude::*; use icu_provider::inv::InvariantDataProvider; use icu_provider::hello_world::{key, HelloWorldV1Marker}; use std::borrow::Cow; let provider = InvariantDataProvider; let result: DataPayload<HelloWorldV1Marker> = provider .load_payload(&DataRequest::from(key::HELLO_WORLD_V1)) .unwrap() .take_payload() .unwrap(); assert_eq!("(und) Hello World", result.get().message);
Trait Implementations
impl<'data, M> DataProvider<'data, M> for InvariantDataProvider where
M: DataMarker<'data>,
M::Cart: Default,
M::Yokeable: ZeroCopyFrom<M::Cart>,
impl<'data, M> DataProvider<'data, M> for InvariantDataProvider where
M: DataMarker<'data>,
M::Cart: Default,
M::Yokeable: ZeroCopyFrom<M::Cart>,
Query the provider for data, returning the result. Read more
fn supported_options_for_key(
&self,
_resc_key: &ResourceKey
) -> Result<Box<dyn Iterator<Item = ResourceOptions>>, Error>
fn supported_options_for_key(
&self,
_resc_key: &ResourceKey
) -> Result<Box<dyn Iterator<Item = ResourceOptions>>, Error>
Given a ResourceKey
, returns a boxed iterator over ResourceOptions
.
Auto Trait Implementations
impl RefUnwindSafe for InvariantDataProvider
impl Send for InvariantDataProvider
impl Sync for InvariantDataProvider
impl Unpin for InvariantDataProvider
impl UnwindSafe for InvariantDataProvider
Blanket Implementations
Mutably borrows from an owned value. Read more
Clone this trait object reference, returning a boxed trait object.