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
Source§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>
Source§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<I: PartialOrd> PartialOrd for Literal<I>
impl<I: PartialOrd> PartialOrd for Literal<I>
Source§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<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.