pub struct LenientLangTagBuf(/* private fields */);
Expand description
Owned language tag that may not be well-formed.
Implementations§
Source§impl LenientLangTagBuf
impl LenientLangTagBuf
pub fn new(s: String) -> (LenientLangTagBuf, Option<InvalidLangTag<String>>)
pub fn as_lenient_lang_tag_ref(&self) -> &LenientLangTag
pub fn into_string(self) -> String
pub fn into_well_formed(self) -> Result<LangTagBuf, InvalidLangTag<String>>
Methods from Deref<Target = LenientLangTag>§
Trait Implementations§
Source§impl AsRef<LenientLangTag> for LenientLangTagBuf
impl AsRef<LenientLangTag> for LenientLangTagBuf
Source§fn as_ref(&self) -> &LenientLangTag
fn as_ref(&self) -> &LenientLangTag
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Borrow<LenientLangTag> for LenientLangTagBuf
impl Borrow<LenientLangTag> for LenientLangTagBuf
Source§fn borrow(&self) -> &LenientLangTag
fn borrow(&self) -> &LenientLangTag
Immutably borrows from an owned value. Read more
Source§impl Clone for LenientLangTagBuf
impl Clone for LenientLangTagBuf
Source§fn clone(&self) -> LenientLangTagBuf
fn clone(&self) -> LenientLangTagBuf
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for LenientLangTagBuf
impl Debug for LenientLangTagBuf
Source§impl Deref for LenientLangTagBuf
impl Deref for LenientLangTagBuf
Source§type Target = LenientLangTag
type Target = LenientLangTag
The resulting type after dereferencing.
Source§impl<'de> Deserialize<'de> for LenientLangTagBuf
impl<'de> Deserialize<'de> for LenientLangTagBuf
Source§fn deserialize<D>(
deserializer: D,
) -> Result<LenientLangTagBuf, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<LenientLangTagBuf, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for LenientLangTagBuf
impl Display for LenientLangTagBuf
Source§impl From<LangTagBuf> for LenientLangTagBuf
impl From<LangTagBuf> for LenientLangTagBuf
Source§fn from(tag: LangTagBuf) -> LenientLangTagBuf
fn from(tag: LangTagBuf) -> LenientLangTagBuf
Converts to this type from the input type.
Source§impl From<String> for LenientLangTagBuf
impl From<String> for LenientLangTagBuf
Source§fn from(tag: String) -> LenientLangTagBuf
fn from(tag: String) -> LenientLangTagBuf
Converts to this type from the input type.
Source§impl Hash for LenientLangTagBuf
impl Hash for LenientLangTagBuf
Source§impl Ord for LenientLangTagBuf
impl Ord for LenientLangTagBuf
Source§fn cmp(&self, other: &LenientLangTagBuf) -> Ordering
fn cmp(&self, other: &LenientLangTagBuf) -> Ordering
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 PartialEq for LenientLangTagBuf
impl PartialEq for LenientLangTagBuf
Source§impl PartialOrd for LenientLangTagBuf
impl PartialOrd for LenientLangTagBuf
Source§impl PrecomputeSize for LenientLangTagBuf
impl PrecomputeSize for LenientLangTagBuf
Source§impl Print for LenientLangTagBuf
impl Print for LenientLangTagBuf
fn fmt_with( &self, f: &mut Formatter<'_>, _options: &Options, _indent: usize, ) -> Result<(), Error>
Source§fn pretty_print(&self) -> Printed<'_, Self>
fn pretty_print(&self) -> Printed<'_, Self>
Print the value with
Options::pretty
options.Source§fn compact_print(&self) -> Printed<'_, Self>
fn compact_print(&self) -> Printed<'_, Self>
Print the value with
Options::compact
options.Source§fn inline_print(&self) -> Printed<'_, Self>
fn inline_print(&self) -> Printed<'_, Self>
Print the value with
Options::inline
options.Source§fn print_with(&self, options: Options) -> Printed<'_, Self>
fn print_with(&self, options: Options) -> Printed<'_, Self>
Print the value with the given options.
Source§impl Serialize for LenientLangTagBuf
impl Serialize for LenientLangTagBuf
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
Source§impl TryFromJson for LenientLangTagBuf
impl TryFromJson for LenientLangTagBuf
type Error = InvalidContext
fn try_from_json(value: Value) -> Result<LenientLangTagBuf, InvalidContext>
impl Eq for LenientLangTagBuf
Auto Trait Implementations§
impl Freeze for LenientLangTagBuf
impl RefUnwindSafe for LenientLangTagBuf
impl Send for LenientLangTagBuf
impl Sync for LenientLangTagBuf
impl Unpin for LenientLangTagBuf
impl UnwindSafe for LenientLangTagBuf
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
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.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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.