Struct icu_provider::prelude::ResourceOptions [−][src]
pub struct ResourceOptions { pub variant: Option<Cow<'static, str>>, pub langid: Option<LanguageIdentifier>, }
Expand description
A variant and language identifier, used for requesting data from a
DataProvider
.
The fields in a ResourceOptions
are not generally known until runtime.
Fields
variant: Option<Cow<'static, str>>
langid: Option<LanguageIdentifier>
Implementations
Gets the standard path components of this ResourceOptions
. These components should be used when
persisting the ResourceOptions
on the filesystem or in structured data.
Examples
use std::borrow::Cow; use icu_provider::prelude::*; use icu_locid_macros::langid; let resc_options = ResourceOptions { variant: Some(Cow::Borrowed("GBP")), langid: Some(langid!("pt_BR")), }; let components = resc_options.get_components(); assert_eq!( ["GBP", "pt-BR"], components.iter().collect::<Vec<&str>>()[..] );
Returns whether this ResourceOptions
has all empty fields (no components).
Trait Implementations
Create a ResourceOptions with the given language identifier and an empty variant field.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for ResourceOptions
impl Send for ResourceOptions
impl Sync for ResourceOptions
impl Unpin for ResourceOptions
impl UnwindSafe for ResourceOptions
Blanket Implementations
Mutably borrows from an owned value. Read more
Clone this trait object reference, returning a boxed trait object.