Struct json_ld::LenientLangTag

source ·
pub struct LenientLangTag(/* private fields */);
Expand description

Language tag that may not be well-formed.

Implementations§

source§

impl LenientLangTag

source

pub fn new(s: &str) -> (&LenientLangTag, Option<InvalidLangTag<&str>>)

source

pub fn as_bytes(&self) -> &[u8]

source

pub fn as_str(&self) -> &str

source

pub fn is_well_formed(&self) -> bool

source

pub fn as_well_formed(&self) -> Option<&LangTag>

Trait Implementations§

source§

impl AsRef<LenientLangTag> for LenientLangTagBuf

source§

fn as_ref(&self) -> &LenientLangTag

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<str> for LenientLangTag

source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Borrow<LenientLangTag> for LenientLangTagBuf

source§

fn borrow(&self) -> &LenientLangTag

Immutably borrows from an owned value. Read more
source§

impl Borrow<str> for LenientLangTag

source§

fn borrow(&self) -> &str

Immutably borrows from an owned value. Read more
source§

impl Debug for LenientLangTag

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Display for LenientLangTag

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Hash for LenientLangTag

source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
source§

impl Ord for LenientLangTag

source§

fn cmp(&self, other: &LenientLangTag) -> Ordering

This method returns an Ordering between self and other. Read more
source§

impl PartialEq for LenientLangTag

source§

fn eq(&self, other: &LenientLangTag) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for LenientLangTag

source§

fn partial_cmp(&self, other: &LenientLangTag) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PrecomputeSize for LenientLangTag

source§

fn pre_compute_size(&self, _options: &Options, _sizes: &mut Vec<Size>) -> Size

source§

impl Print for LenientLangTag

source§

fn fmt_with( &self, f: &mut Formatter<'_>, _options: &Options, _indent: usize ) -> Result<(), Error>

source§

fn pretty_print(&self) -> Printed<'_, Self>

Print the value with Options::pretty options.
source§

fn compact_print(&self) -> Printed<'_, Self>

Print the value with Options::compact options.
source§

fn inline_print(&self) -> Printed<'_, Self>

Print the value with Options::inline options.
source§

fn print_with(&self, options: Options) -> Printed<'_, Self>

Print the value with the given options.
source§

impl ToOwned for LenientLangTag

§

type Owned = LenientLangTagBuf

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> <LenientLangTag as ToOwned>::Owned

Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · source§

fn clone_into(&self, target: &mut Self::Owned)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl Eq for LenientLangTag

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CallHasher for T
where T: Hash + ?Sized,

source§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64
where H: Hash + ?Sized, B: BuildHasher,

source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

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
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T> WithContext for T
where T: ?Sized,

source§

fn with<C>(&self, context: C) -> Contextual<&T, C>

source§

fn into_with<C>(self, context: C) -> Contextual<T, C>