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 IterableDataProviderCore for InvariantDataProvider[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.