Struct icu_provider::prelude::ResourceOptions [−][src]
pub struct ResourceOptions { pub variant: Option<Cow<'static, str>>, pub langid: Option<LanguageIdentifier>, }
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
impl ResourceOptions
[src]
impl ResourceOptions
[src]pub fn get_components(&self) -> ResourceOptionsComponents
[src]
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>>()[..] );
pub fn is_empty(&self) -> bool
[src]
Returns whether this ResourceOptions
has all empty fields (no components).
Trait Implementations
impl Clone for ResourceOptions
[src]
impl Clone for ResourceOptions
[src]fn clone(&self) -> ResourceOptions
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for ResourceOptions
[src]
impl Default for ResourceOptions
[src]impl PartialEq<ResourceOptions> for ResourceOptions
[src]
impl PartialEq<ResourceOptions> for ResourceOptions
[src]fn eq(&self, other: &ResourceOptions) -> bool
[src]
fn ne(&self, other: &ResourceOptions) -> bool
[src]
impl StructuralPartialEq for ResourceOptions
[src]
impl StructuralPartialEq for ResourceOptions
[src]impl Writeable for ResourceOptions
[src]
impl Writeable for ResourceOptions
[src]Auto Trait Implementations
impl RefUnwindSafe for ResourceOptions
impl RefUnwindSafe for ResourceOptions
impl Send for ResourceOptions
impl Send for ResourceOptions
impl Sync for ResourceOptions
impl Sync for ResourceOptions
impl Unpin for ResourceOptions
impl Unpin for ResourceOptions
impl UnwindSafe for ResourceOptions
impl UnwindSafe for ResourceOptions