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<Self, InvalidLangString>
pub fn new( data: &'a str, language: Option<&'a LenientLangTag>, direction: Option<Direction>, ) -> Result<Self, 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> PartialOrd for LangStr<'a>
impl<'a> PartialOrd for LangStr<'a>
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§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
fn equivalent(&self, key: &K) -> bool
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.