pub struct LangStr<'a> { /* private fields */ }
Expand description
Language string reference.
A language string is a string tagged with language and reading direction information.
A valid language string is associated to either a language tag or a direction, or both.
Implementations§
source§impl<'a> LangStr<'a>
impl<'a> LangStr<'a>
sourcepub fn new(
data: &'a str,
language: Option<&'a LenientLangTag>,
direction: Option<Direction>,
) -> Result<LangStr<'a>, InvalidLangString>
pub fn new( data: &'a str, language: Option<&'a LenientLangTag>, direction: Option<Direction>, ) -> Result<LangStr<'a>, InvalidLangString>
Create a new language string reference.
pub fn into_parts( self, ) -> (&'a str, Option<&'a LenientLangTag>, Option<Direction>)
sourcepub fn language(&self) -> Option<&'a LenientLangTag>
pub fn language(&self) -> Option<&'a LenientLangTag>
Gets the associated language tag, if any.
Trait Implementations§
source§impl<'a> Ord for LangStr<'a>
impl<'a> Ord for LangStr<'a>
1.21.0 · 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<'a> PartialEq for LangStr<'a>
impl<'a> PartialEq for LangStr<'a>
source§impl<'a> PartialOrd for LangStr<'a>
impl<'a> PartialOrd for LangStr<'a>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<'a> Serialize for LangStr<'a>
impl<'a> Serialize for LangStr<'a>
source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'a> Copy for LangStr<'a>
impl<'a> Eq for LangStr<'a>
impl<'a> StructuralPartialEq for LangStr<'a>
Auto Trait Implementations§
impl<'a> Freeze for LangStr<'a>
impl<'a> RefUnwindSafe for LangStr<'a>
impl<'a> Send for LangStr<'a>
impl<'a> Sync for LangStr<'a>
impl<'a> Unpin for LangStr<'a>
impl<'a> UnwindSafe for LangStr<'a>
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
source§impl<T> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<T>
source§impl<T> CallHasher for T
impl<T> CallHasher for T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.