pub struct Literal<I = IriBuf> {
pub value: String,
pub type_: LiteralType<I>,
}
Expand description
RDF Literal.
Fields§
§value: String
Literal value.
type_: LiteralType<I>
Literal type.
Implementations§
source§impl<I> Literal<I>
impl<I> Literal<I>
pub fn new(value: String, type_: LiteralType<I>) -> Self
pub fn as_type(&self) -> &LiteralType<I>
pub fn as_type_mut(&mut self) -> &mut LiteralType<I>
pub fn into_type(self) -> LiteralType<I>
pub fn as_value(&self) -> &String
pub fn as_value_mut(&mut self) -> &mut String
pub fn into_value(self) -> String
pub fn into_parts(self) -> (String, LiteralType<I>)
pub fn as_str(&self) -> &str
pub fn as_bytes(&self) -> &[u8] ⓘ
pub fn is_lang_string(&self) -> bool
pub fn lang_tag(&self) -> Option<&LangTag>
pub fn insert_type_into_vocabulary<V>(
self,
vocabulary: &mut V
) -> Literal<I::Embedded>where
I: EmbedIntoVocabulary<V>,
pub fn inserted_type_into_vocabulary<V>(
&self,
vocabulary: &mut V
) -> Literal<I::Embedded>where
I: EmbeddedIntoVocabulary<V>,
pub fn as_ref(&self) -> LiteralRef<'_, I>
Trait Implementations§
source§impl<V: IriVocabularyMut + LiteralVocabularyMut> EmbedIntoVocabulary<V> for Literal
impl<V: IriVocabularyMut + LiteralVocabularyMut> EmbedIntoVocabulary<V> for Literal
§type Embedded = <V as LiteralVocabulary>::Literal
type Embedded = <V as LiteralVocabulary>::Literal
Type of the value once embedded into the vocabulary.
fn embed_into_vocabulary(self, vocabulary: &mut V) -> Self::Embedded
source§impl<V: IriVocabularyMut + LiteralVocabularyMut> EmbeddedIntoVocabulary<V> for Literal
impl<V: IriVocabularyMut + LiteralVocabularyMut> EmbeddedIntoVocabulary<V> for Literal
type Embedded = <V as LiteralVocabulary>::Literal
fn embedded_into_vocabulary(&self, vocabulary: &mut V) -> Self::Embedded
source§impl<V: IriVocabulary> ExtractFromVocabulary<V> for Literal<V::Iri>
impl<V: IriVocabulary> ExtractFromVocabulary<V> for Literal<V::Iri>
source§impl<V: IriVocabulary> ExtractedFromVocabulary<V> for Literal<V::Iri>
impl<V: IriVocabulary> ExtractedFromVocabulary<V> for Literal<V::Iri>
source§impl<T, I: LiteralInterpretationMut<Self>> Interpret<I> for Literal<T>
impl<T, I: LiteralInterpretationMut<Self>> Interpret<I> for Literal<T>
§type Interpreted = <I as Interpretation>::Resource
type Interpreted = <I as Interpretation>::Resource
Interpreted form.
source§fn interpret(self, interpretation: &mut I) -> Self::Interpreted
fn interpret(self, interpretation: &mut I) -> Self::Interpreted
Interpret the given resource.
source§impl LiteralInterpretation<Literal> for ()
impl LiteralInterpretation<Literal> for ()
source§fn literal_interpretation(&self, literal: &Literal) -> Option<Self::Resource>
fn literal_interpretation(&self, literal: &Literal) -> Option<Self::Resource>
Returns the interpretation of the given literal value, if any.
fn lexical_literal_interpretation<V: LiteralVocabulary<Literal = L>>( &self, vocabulary: &V, literal: LiteralRef<'_, V::Iri> ) -> Option<Self::Resource>
source§impl<I: Ord> Ord for Literal<I>
impl<I: Ord> Ord for Literal<I>
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, I: PartialEq> PartialEq<Literal<I>> for LiteralRef<'a, I>
impl<'a, I: PartialEq> PartialEq<Literal<I>> for LiteralRef<'a, I>
source§impl<'a, I: PartialEq> PartialEq<LiteralRef<'a, I>> for Literal<I>
impl<'a, I: PartialEq> PartialEq<LiteralRef<'a, I>> for Literal<I>
source§fn eq(&self, other: &LiteralRef<'a, I>) -> bool
fn eq(&self, other: &LiteralRef<'a, I>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<I: PartialEq> PartialEq for Literal<I>
impl<I: PartialEq> PartialEq for Literal<I>
source§impl<I: PartialOrd> PartialOrd for Literal<I>
impl<I: PartialOrd> PartialOrd for Literal<I>
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<I: RdfDisplay + IsXsdStringIri> RdfDisplay for Literal<I>
impl<I: RdfDisplay + IsXsdStringIri> RdfDisplay for Literal<I>
source§fn rdf_fmt(&self, f: &mut Formatter<'_>) -> Result
fn rdf_fmt(&self, f: &mut Formatter<'_>) -> Result
Formats the value using the given formatter.
source§fn rdf_display(&self) -> RdfDisplayed<&Self>
fn rdf_display(&self) -> RdfDisplayed<&Self>
Prepare the value to be formatted as an RDF syntax element.
source§impl<T> TryFrom<Literal<T>> for LiteralIndex
impl<T> TryFrom<Literal<T>> for LiteralIndex
impl<I: Eq> Eq for Literal<I>
impl<I> StructuralPartialEq for Literal<I>
Auto Trait Implementations§
impl<I> Freeze for Literal<I>where
I: Freeze,
impl<I> RefUnwindSafe for Literal<I>where
I: RefUnwindSafe,
impl<I> Send for Literal<I>where
I: Send,
impl<I> Sync for Literal<I>where
I: Sync,
impl<I> Unpin for Literal<I>where
I: Unpin,
impl<I> UnwindSafe for Literal<I>where
I: UnwindSafe,
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<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.