pub struct Language { /* private fields */ }Expand description
Wraps a Translation.framework language identifier.
Implementations§
Source§impl Language
impl Language
Sourcepub fn new(identifier: impl Into<String>) -> Self
pub fn new(identifier: impl Into<String>) -> Self
Creates a language wrapper from a BCP-47 identifier.
Sourcepub fn identifier(&self) -> &str
pub fn identifier(&self) -> &str
Returns the wrapped language identifier.
Sourcepub fn canonicalized(&self) -> Result<Self, TranslationError>
pub fn canonicalized(&self) -> Result<Self, TranslationError>
Returns the Translation.framework-canonicalized language identifier.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Language
impl<'de> Deserialize<'de> for Language
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Language
impl Ord for Language
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Language
impl PartialOrd for Language
impl Eq for Language
impl StructuralPartialEq for Language
Auto Trait Implementations§
impl Freeze for Language
impl RefUnwindSafe for Language
impl Send for Language
impl Sync for Language
impl Unpin for Language
impl UnsafeUnpin for Language
impl UnwindSafe for Language
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more