Struct icu_provider::inv::InvariantDataProvider [−][src]
pub struct InvariantDataProvider;
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, HelloWorldV1}; use std::borrow::Cow; let provider = InvariantDataProvider; let result: Cow<HelloWorldV1> = provider .load_payload(&DataRequest::from(key::HELLO_WORLD_V1)) .unwrap() .payload.take() .unwrap(); assert_eq!("(und) Hello World", result.message);
Trait Implementations
impl<'d, T> DataProvider<'d, T> for InvariantDataProvider where
T: Clone + Debug + Default + 'd,
[src]
impl<'d, T> DataProvider<'d, T> for InvariantDataProvider where
T: Clone + Debug + Default + 'd,
[src]fn load_payload(&self, _req: &DataRequest) -> Result<DataResponse<'d, T>, Error>
[src]
impl IterableDataProviderCore for InvariantDataProvider
[src]
impl IterableDataProviderCore for InvariantDataProvider
[src]fn supported_options_for_key(
&self,
_resc_key: &ResourceKey
) -> Result<Box<dyn Iterator<Item = ResourceOptions>>, Error>
[src]
&self,
_resc_key: &ResourceKey
) -> Result<Box<dyn Iterator<Item = ResourceOptions>>, Error>
Auto Trait Implementations
impl RefUnwindSafe for InvariantDataProvider
impl RefUnwindSafe for InvariantDataProvider
impl Send for InvariantDataProvider
impl Send for InvariantDataProvider
impl Sync for InvariantDataProvider
impl Sync for InvariantDataProvider
impl Unpin for InvariantDataProvider
impl Unpin for InvariantDataProvider
impl UnwindSafe for InvariantDataProvider
impl UnwindSafe for InvariantDataProvider