Struct rdf_types::LiteralRef

source ·
pub struct LiteralRef<'a, I = IriBuf> {
    pub value: &'a str,
    pub type_: LiteralTypeRef<'a, I>,
}
Expand description

RDF Literal reference.

Fields§

§value: &'a str

Literal value.

§type_: LiteralTypeRef<'a, I>

Literal type.

Implementations§

source§

impl<'a, I> LiteralRef<'a, I>

source

pub fn new(value: &'a str, type_: LiteralTypeRef<'a, I>) -> Self

source

pub fn as_type(&self) -> LiteralTypeRef<'a, I>

source

pub fn as_type_mut(&mut self) -> &mut LiteralTypeRef<'a, I>

source

pub fn into_type(self) -> LiteralTypeRef<'a, I>

source

pub fn as_value(&self) -> &'a str

source

pub fn into_value(self) -> &'a str

source

pub fn into_parts(self) -> (&'a str, LiteralTypeRef<'a, I>)

source

pub fn as_str(&self) -> &'a str

source

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

source

pub fn is_lang_string(&self) -> bool

source

pub fn lang_tag(&self) -> Option<&'a LangTag>

source

pub fn insert_type_into_vocabulary<V>( self, vocabulary: &mut V ) -> Literal<I::Embedded>

source

pub fn inserted_type_into_vocabulary<V>( &self, vocabulary: &mut V ) -> Literal<I::Embedded>

source§

impl<'a, I: ToOwned> LiteralRef<'a, I>

source

pub fn into_owned(self) -> Literal<I::Owned>

source§

impl<'a, I> LiteralRef<'a, I>

source

pub fn cast_into_owned<J>(self) -> Literal<J>
where &'a I: Into<J>,

Trait Implementations§

source§

impl<'a, I> AsRef<str> for LiteralRef<'a, I>

source§

fn as_ref(&self) -> &str

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

impl<'a, I> Borrow<str> for LiteralRef<'a, I>

source§

fn borrow(&self) -> &str

Immutably borrows from an owned value. Read more
source§

impl<'a, I> Clone for LiteralRef<'a, I>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a, I: Debug> Debug for LiteralRef<'a, I>

source§

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

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

impl<'a> Display for LiteralRef<'a>

source§

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

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

impl<'a, V: LiteralVocabularyMut> EmbedIntoVocabulary<V> for LiteralRef<'a, V::Iri>
where V::Iri: Clone,

§

type Embedded = <V as LiteralVocabulary>::Literal

Type of the value once embedded into the vocabulary.
source§

fn embed_into_vocabulary(self, vocabulary: &mut V) -> Self::Embedded

source§

impl<'a, V: LiteralVocabularyMut> EmbeddedIntoVocabulary<V> for LiteralRef<'a, V::Iri>
where V::Iri: Clone,

source§

impl<'a, V: IriVocabulary> ExtractFromVocabulary<V> for LiteralRef<'a, V::Iri>

§

type Extracted = Literal

source§

fn extract_from_vocabulary(self, vocabulary: &V) -> Self::Extracted

source§

impl<'a, V: IriVocabulary> ExtractedFromVocabulary<V> for LiteralRef<'a, V::Iri>

§

type Extracted = Literal

source§

fn extracted_from_vocabulary(&self, vocabulary: &V) -> Self::Extracted

Exports a value embedded into the vocabulary V. Read more
source§

impl<'a, I: Hash> Hash for LiteralRef<'a, I>

source§

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

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

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<'a, I: Ord> Ord for LiteralRef<'a, I>

source§

fn cmp(&self, other: &LiteralRef<'a, I>) -> Ordering

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

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl<'a, I: PartialEq> PartialEq<Literal<I>> for LiteralRef<'a, I>

source§

fn eq(&self, other: &Literal<I>) -> 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<'a, I: PartialEq> PartialEq<LiteralRef<'a, I>> for Literal<I>

source§

fn eq(&self, other: &LiteralRef<'a, I>) -> 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<'a, I: PartialEq> PartialEq for LiteralRef<'a, I>

source§

fn eq(&self, other: &LiteralRef<'a, I>) -> 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<'a, I: PartialOrd> PartialOrd for LiteralRef<'a, I>

source§

fn partial_cmp(&self, other: &LiteralRef<'a, I>) -> 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<'a, I: RdfDisplay + IsXsdStringIri> RdfDisplay for LiteralRef<'a, I>

source§

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

Formats the value using the given formatter.
source§

fn rdf_display(&self) -> RdfDisplayed<&Self>

Prepare the value to be formatted as an RDF syntax element.
source§

impl<'a, I, L: TryFrom<LiteralRef<'a, I>>> TryFrom<LiteralRef<'a, I>> for LiteralOrIndex<L>

§

type Error = <L as TryFrom<LiteralRef<'a, I>>>::Error

The type returned in the event of a conversion error.
source§

fn try_from(literal: LiteralRef<'a, I>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a, T> TryFrom<LiteralRef<'a, T>> for LiteralIndex

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(_value: LiteralRef<'a, T>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a, I> Copy for LiteralRef<'a, I>

source§

impl<'a, I: Eq> Eq for LiteralRef<'a, I>

source§

impl<'a, I> StructuralPartialEq for LiteralRef<'a, I>

Auto Trait Implementations§

§

impl<'a, I> Freeze for LiteralRef<'a, I>

§

impl<'a, I> RefUnwindSafe for LiteralRef<'a, I>
where I: RefUnwindSafe,

§

impl<'a, I> Send for LiteralRef<'a, I>
where I: Sync,

§

impl<'a, I> Sync for LiteralRef<'a, I>
where I: Sync,

§

impl<'a, I> Unpin for LiteralRef<'a, I>

§

impl<'a, I> UnwindSafe for LiteralRef<'a, I>
where I: RefUnwindSafe,

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<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<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.