pub struct Literal<T = Type<IriBuf, LanguageTagBuf>, S = String> { /* private fields */ }Expand description
RDF Literal.
Implementations§
source§impl<T, S> Literal<T, S>
impl<T, S> Literal<T, S>
pub fn new(value: S, type_: T) -> Self
pub fn type_(&self) -> &T
pub fn type_mut(&mut self) -> &mut T
pub fn into_type_(self) -> T
pub fn value(&self) -> &S
pub fn value_mut(&mut self) -> &mut S
pub fn into_value(self) -> S
pub fn into_parts(self) -> (S, T)
pub fn as_str(&self) -> &str
pub fn as_str_mut(&mut self) -> &mut str
pub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
pub fn insert_type_into_vocabulary<V>(
self,
vocabulary: &mut V
) -> Literal<T::Inserted, S>where
T: InsertIntoVocabulary<V>,
pub fn inserted_type_into_vocabulary<V>(
&self,
vocabulary: &mut V
) -> Literal<T::Inserted, S>where
T: InsertedIntoVocabulary<V>,
S: Clone,
Trait Implementations§
source§impl<T, S: AsRef<str> + AsMut<str>> BorrowMut<str> for Literal<T, S>
impl<T, S: AsRef<str> + AsMut<str>> BorrowMut<str> for Literal<T, S>
source§fn borrow_mut(&mut self) -> &mut str
fn borrow_mut(&mut self) -> &mut str
Mutably borrows from an owned value. Read more
source§impl<T: RdfDisplay + RdfDisplayType, S: RdfDisplay> Display for Literal<T, S>
impl<T: RdfDisplay + RdfDisplayType, S: RdfDisplay> Display for Literal<T, S>
source§impl<V: LiteralVocabulary> ExportFromVocabulary<V> for Literal<V::Type, V::Value>where
V::Type: ExportFromVocabulary<V>,
impl<V: LiteralVocabulary> ExportFromVocabulary<V> for Literal<V::Type, V::Value>where
V::Type: ExportFromVocabulary<V>,
type Output = Literal<<<V as LiteralVocabulary>::Type as ExportFromVocabulary<V>>::Output, <V as LiteralVocabulary>::Value>
fn export_from_vocabulary(self, vocabulary: &V) -> Self::Output
source§impl<V: LiteralVocabulary> ExportedFromVocabulary<V> for Literal<V::Type, V::Value>
impl<V: LiteralVocabulary> ExportedFromVocabulary<V> for Literal<V::Type, V::Value>
type Output = Literal<<<V as LiteralVocabulary>::Type as ExportedFromVocabulary<V>>::Output, <V as LiteralVocabulary>::Value>
source§impl<V: LiteralVocabularyMut> InsertIntoVocabulary<V> for Literal<V::Type, V::Value>
impl<V: LiteralVocabularyMut> InsertIntoVocabulary<V> for Literal<V::Type, V::Value>
type Inserted = <V as LiteralVocabulary>::Literal
fn insert_into_vocabulary(self, vocabulary: &mut V) -> Self::Inserted
source§impl<V: LiteralVocabularyMut> InsertedIntoVocabulary<V> for Literal<V::Type, V::Value>
impl<V: LiteralVocabularyMut> InsertedIntoVocabulary<V> for Literal<V::Type, V::Value>
type Inserted = <V as LiteralVocabulary>::Literal
fn inserted_into_vocabulary(&self, vocabulary: &mut V) -> Self::Inserted
source§impl<T, S, I: LiteralInterpretationMut<Self>> Interpret<I> for Literal<T, S>
impl<T, S, I: LiteralInterpretationMut<Self>> Interpret<I> for Literal<T, S>
§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<T, S> IntoLiteral for Literal<T, S>
impl<T, S> IntoLiteral for Literal<T, S>
source§fn into_literal(self) -> Self
fn into_literal(self) -> Self
Turns the value into a
Literal.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: &Literal<V::Type, V::Value> ) -> Option<Self::Resource>
source§impl<T: Ord, S: Ord> Ord for Literal<T, S>
impl<T: Ord, S: Ord> Ord for Literal<T, S>
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<T: PartialEq, S: PartialEq> PartialEq for Literal<T, S>
impl<T: PartialEq, S: PartialEq> PartialEq for Literal<T, S>
source§impl<T: PartialOrd, S: PartialOrd> PartialOrd for Literal<T, S>
impl<T: PartialOrd, S: PartialOrd> PartialOrd for Literal<T, S>
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<T: RdfDisplay + RdfDisplayType, S: RdfDisplay> RdfDisplay for Literal<T, S>
impl<T: RdfDisplay + RdfDisplayType, S: RdfDisplay> RdfDisplay for Literal<T, S>
fn rdf_fmt(&self, f: &mut Formatter<'_>) -> Result
fn rdf_display(&self) -> RdfDisplayed<&Self>
source§impl<T: TryExportLiteralType<V>, S: Into<String>, V> TryExportLiteral<V> for Literal<T, S>
impl<T: TryExportLiteralType<V>, S: Into<String>, V> TryExportLiteral<V> for Literal<T, S>
source§impl<'a, T, S> TryFrom<&'a Literal<T, S>> for LiteralIndex
impl<'a, T, S> TryFrom<&'a Literal<T, S>> for LiteralIndex
source§impl<'a, T, S, L: TryFrom<&'a Literal<T, S>>> TryFrom<&'a Literal<T, S>> for LiteralOrIndex<L>
impl<'a, T, S, L: TryFrom<&'a Literal<T, S>>> TryFrom<&'a Literal<T, S>> for LiteralOrIndex<L>
impl<T: Copy, S: Copy> Copy for Literal<T, S>
impl<T: Eq, S: Eq> Eq for Literal<T, S>
impl<T, S> StructuralEq for Literal<T, S>
impl<T, S> StructuralPartialEq for Literal<T, S>
Auto Trait Implementations§
impl<T, S> RefUnwindSafe for Literal<T, S>where
S: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, S> Send for Literal<T, S>
impl<T, S> Sync for Literal<T, S>
impl<T, S> Unpin for Literal<T, S>
impl<T, S> UnwindSafe for Literal<T, S>where
S: UnwindSafe,
T: 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> 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.