pub enum Term<I = Id, L = Literal> {
Id(I),
Literal(L),
}Expand description
gRDF term.
Either a node identifier or a literal value.
§Hash implementation
It is guaranteed that the Hash implementation of Term is transparent,
meaning that the hash of Term::Id(id) the same as id and the hash of
Term::Literal(l) is the same as l.
Variants§
Implementations§
Source§impl<I, L> Term<I, L>
impl<I, L> Term<I, L>
pub fn blank(id: <I as MaybeBlankId>::BlankId) -> Term<I, L>where
I: FromBlankId,
pub fn iri(iri: <I as MaybeIri>::Iri) -> Term<I, L>where
I: FromIri,
pub fn is_id(&self) -> bool
pub fn is_literal(&self) -> bool
pub fn as_id(&self) -> Option<&I>
pub fn into_id(self) -> Option<I>
pub fn try_into_id(self) -> Result<I, L>
pub fn as_literal(&self) -> Option<&L>
pub fn into_literal(self) -> Option<L>
pub fn try_into_literal(self) -> Result<L, I>
pub fn is_blank(&self) -> boolwhere
I: TryAsBlankId,
pub fn is_iri(&self) -> boolwhere
I: TryAsIri,
pub fn as_blank(&self) -> Option<&<I as MaybeBlankId>::BlankId>where
I: TryAsBlankId,
pub fn try_into_blank(self) -> Result<<I as MaybeBlankId>::BlankId, Term<I, L>>where
I: TryIntoBlankId,
pub fn into_blank(self) -> Option<<I as MaybeBlankId>::BlankId>where
I: TryIntoBlankId,
pub fn as_iri(&self) -> Option<&<I as MaybeIri>::Iri>where
I: TryAsIri,
pub fn try_into_iri(self) -> Result<<I as MaybeIri>::Iri, Term<I, L>>where
I: TryIntoIri,
pub fn into_iri(self) -> Option<<I as MaybeIri>::Iri>where
I: TryIntoIri,
Trait Implementations§
Source§impl<I, L, V> AsRefWithContext<str, V> for Term<I, L>
Available on crate feature contextual only.
impl<I, L, V> AsRefWithContext<str, V> for Term<I, L>
Available on crate feature
contextual only.fn as_ref_with<'a>(&'a self, vocabulary: &'a V) -> &'a str
Source§impl<I, L, V> DisplayWithContext<V> for Term<I, L>where
I: DisplayWithContext<V>,
L: DisplayWithContext<V>,
Available on crate feature contextual only.
impl<I, L, V> DisplayWithContext<V> for Term<I, L>where
I: DisplayWithContext<V>,
L: DisplayWithContext<V>,
Available on crate feature
contextual only.Source§impl<V, I, L> EmbedIntoVocabulary<V> for Term<I, L>where
I: EmbedIntoVocabulary<V>,
L: EmbedIntoVocabulary<V>,
impl<V, I, L> EmbedIntoVocabulary<V> for Term<I, L>where
I: EmbedIntoVocabulary<V>,
L: EmbedIntoVocabulary<V>,
Source§type Embedded = Term<<I as EmbedIntoVocabulary<V>>::Embedded, <L as EmbedIntoVocabulary<V>>::Embedded>
type Embedded = Term<<I as EmbedIntoVocabulary<V>>::Embedded, <L as EmbedIntoVocabulary<V>>::Embedded>
Type of the value once embedded into the vocabulary.
fn embed_into_vocabulary( self, vocabulary: &mut V, ) -> <Term<I, L> as EmbedIntoVocabulary<V>>::Embedded
Source§impl<V, I, L> EmbeddedIntoVocabulary<V> for Term<I, L>where
I: EmbeddedIntoVocabulary<V>,
L: EmbeddedIntoVocabulary<V>,
impl<V, I, L> EmbeddedIntoVocabulary<V> for Term<I, L>where
I: EmbeddedIntoVocabulary<V>,
L: EmbeddedIntoVocabulary<V>,
type Embedded = Term<<I as EmbeddedIntoVocabulary<V>>::Embedded, <L as EmbeddedIntoVocabulary<V>>::Embedded>
fn embedded_into_vocabulary( &self, vocabulary: &mut V, ) -> <Term<I, L> as EmbeddedIntoVocabulary<V>>::Embedded
Source§impl<V, I> ExtractFromVocabulary<V> for Term<I, <V as LiteralVocabulary>::Literal>where
V: LiteralVocabulary,
I: ExtractFromVocabulary<V>,
impl<V, I> ExtractFromVocabulary<V> for Term<I, <V as LiteralVocabulary>::Literal>where
V: LiteralVocabulary,
I: ExtractFromVocabulary<V>,
type Extracted = Term<<I as ExtractFromVocabulary<V>>::Extracted>
fn extract_from_vocabulary( self, vocabulary: &V, ) -> <Term<I, <V as LiteralVocabulary>::Literal> as ExtractFromVocabulary<V>>::Extracted
Source§impl<V, I> ExtractedFromVocabulary<V> for Term<I, <V as LiteralVocabulary>::Literal>where
V: LiteralVocabulary,
I: ExtractedFromVocabulary<V>,
impl<V, I> ExtractedFromVocabulary<V> for Term<I, <V as LiteralVocabulary>::Literal>where
V: LiteralVocabulary,
I: ExtractedFromVocabulary<V>,
type Extracted = Term<<I as ExtractedFromVocabulary<V>>::Extracted>
Source§fn extracted_from_vocabulary(
&self,
vocabulary: &V,
) -> <Term<I, <V as LiteralVocabulary>::Literal> as ExtractedFromVocabulary<V>>::Extracted
fn extracted_from_vocabulary( &self, vocabulary: &V, ) -> <Term<I, <V as LiteralVocabulary>::Literal> as ExtractedFromVocabulary<V>>::Extracted
Exports a value embedded into the vocabulary
V. Read moreSource§impl<V> From<Term<Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId>, <V as LiteralVocabulary>::Literal>> for Resource<V>where
V: Vocabulary,
impl<V> From<Term<Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId>, <V as LiteralVocabulary>::Literal>> for Resource<V>where
V: Vocabulary,
Source§fn from(
value: Term<Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId>, <V as LiteralVocabulary>::Literal>,
) -> Resource<V>
fn from( value: Term<Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId>, <V as LiteralVocabulary>::Literal>, ) -> Resource<V>
Converts to this type from the input type.
Source§impl<I, L> FromBlankId for Term<I, L>where
I: FromBlankId,
impl<I, L> FromBlankId for Term<I, L>where
I: FromBlankId,
Source§fn from_blank(b: <Term<I, L> as MaybeBlankId>::BlankId) -> Term<I, L>
fn from_blank(b: <Term<I, L> as MaybeBlankId>::BlankId) -> Term<I, L>
Builds a value from a blank node identifier.
Source§impl<I, T, L> Interpret<I> for Term<T, L>where
I: LiteralInterpretationMut<L>,
T: Interpret<I, Interpreted = <I as Interpretation>::Resource>,
impl<I, T, L> Interpret<I> for Term<T, L>where
I: LiteralInterpretationMut<L>,
T: Interpret<I, Interpreted = <I as Interpretation>::Resource>,
Source§type Interpreted = <I as Interpretation>::Resource
type Interpreted = <I as Interpretation>::Resource
Interpreted form.
Source§impl<V, I, T, B, L> LinkedDataResource<I, V> for Term<Id<T, B>, L>where
V: Vocabulary,
I: Interpretation,
T: LinkedDataResource<I, V>,
B: LinkedDataResource<I, V>,
L: LinkedDataResource<I, V>,
impl<V, I, T, B, L> LinkedDataResource<I, V> for Term<Id<T, B>, L>where
V: Vocabulary,
I: Interpretation,
T: LinkedDataResource<I, V>,
B: LinkedDataResource<I, V>,
L: LinkedDataResource<I, V>,
fn interpretation( &self, vocabulary: &mut V, interpretation: &mut I, ) -> ResourceInterpretation<'_, I, V>
fn lexical_representation<'a>(
&'a self,
vocabulary: &'a mut V,
interpretation: &'a mut I,
) -> Option<CowRdfTerm<'a, V>>where
I: ReverseTermInterpretation<Iri = <V as IriVocabulary>::Iri, BlankId = <V as BlankIdVocabulary>::BlankId, Literal = <V as LiteralVocabulary>::Literal>,
fn reference_interpretation( &self, vocabulary: &mut V, interpretation: &mut I, ) -> ResourceInterpretation<'_, I, V>
Source§impl<I, L> MaybeBlankId for Term<I, L>where
I: MaybeBlankId,
impl<I, L> MaybeBlankId for Term<I, L>where
I: MaybeBlankId,
Source§type BlankId = <I as MaybeBlankId>::BlankId
type BlankId = <I as MaybeBlankId>::BlankId
Inner blank node identifier type.
Source§impl<I, L> Ord for Term<I, L>
impl<I, L> Ord for Term<I, L>
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<I1, L1, I2, L2> PartialOrd<Term<I2, L2>> for Term<I1, L1>where
I1: PartialOrd<I2>,
L1: PartialOrd<L2>,
impl<I1, L1, I2, L2> PartialOrd<Term<I2, L2>> for Term<I1, L1>where
I1: PartialOrd<I2>,
L1: PartialOrd<L2>,
Source§impl<I, L> RdfDisplay for Term<I, L>where
I: RdfDisplay,
L: RdfDisplay,
impl<I, L> RdfDisplay for Term<I, L>where
I: RdfDisplay,
L: RdfDisplay,
Source§impl<I, L, V> RdfDisplayWithContext<V> for Term<I, L>where
I: RdfDisplayWithContext<V>,
L: RdfDisplayWithContext<V>,
Available on crate feature contextual only.
impl<I, L, V> RdfDisplayWithContext<V> for Term<I, L>where
I: RdfDisplayWithContext<V>,
L: RdfDisplayWithContext<V>,
Available on crate feature
contextual only.Source§impl<I, L> TryAsBlankId for Term<I, L>where
I: TryAsBlankId,
impl<I, L> TryAsBlankId for Term<I, L>where
I: TryAsBlankId,
Source§impl<V, I, L> TryExtractFromVocabulary<V> for Term<I, L>where
I: TryExtractFromVocabulary<V>,
L: TryExtractFromVocabulary<V>,
impl<V, I, L> TryExtractFromVocabulary<V> for Term<I, L>where
I: TryExtractFromVocabulary<V>,
L: TryExtractFromVocabulary<V>,
type Extracted = Term<<I as TryExtractFromVocabulary<V>>::Extracted, <L as TryExtractFromVocabulary<V>>::Extracted>
type Error = Term<<I as TryExtractFromVocabulary<V>>::Error, <L as TryExtractFromVocabulary<V>>::Error>
fn try_extract_from_vocabulary( self, vocabulary: &V, ) -> Result<<Term<I, L> as TryExtractFromVocabulary<V>>::Extracted, <Term<I, L> as TryExtractFromVocabulary<V>>::Error>
Source§impl<I, L> TryIntoBlankId for Term<I, L>where
I: TryIntoBlankId,
impl<I, L> TryIntoBlankId for Term<I, L>where
I: TryIntoBlankId,
fn try_into_blank( self, ) -> Result<<Term<I, L> as MaybeBlankId>::BlankId, Term<I, L>>
Source§impl<I, L> TryIntoIri for Term<I, L>where
I: TryIntoIri,
impl<I, L> TryIntoIri for Term<I, L>where
I: TryIntoIri,
impl<I, L> Copy for Term<I, L>
impl<I, L> Eq for Term<I, L>
Auto Trait Implementations§
impl<I, L> Freeze for Term<I, L>
impl<I, L> RefUnwindSafe for Term<I, L>where
I: RefUnwindSafe,
L: RefUnwindSafe,
impl<I, L> Send for Term<I, L>
impl<I, L> Sync for Term<I, L>
impl<I, L> Unpin for Term<I, L>
impl<I, L> UnwindSafe for Term<I, L>where
I: UnwindSafe,
L: 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> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<T>
Source§impl<T> CallHasher for T
impl<T> CallHasher for T
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.