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::BlankId) -> Selfwhere
I: FromBlankId,
pub fn iri(iri: I::Iri) -> Selfwhere
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::BlankId>where
I: TryAsBlankId,
pub fn try_into_blank(self) -> Result<I::BlankId, Self>where
I: TryIntoBlankId,
pub fn into_blank(self) -> Option<I::BlankId>where
I: TryIntoBlankId,
pub fn as_iri(&self) -> Option<&I::Iri>where
I: TryAsIri,
pub fn try_into_iri(self) -> Result<I::Iri, Self>where
I: TryIntoIri,
pub fn into_iri(self) -> Option<I::Iri>where
I: TryIntoIri,
Source§impl Term
impl Term
pub fn as_lexical_term_ref(&self) -> LexicalTermRef<'_>
Sourcepub fn as_lexical_object_ref(&self) -> LexicalObjectRef<'_>
pub fn as_lexical_object_ref(&self) -> LexicalObjectRef<'_>
Alias for Self::as_lexical_term_ref
.
Trait Implementations§
Source§impl<V, I: EmbedIntoVocabulary<V>, L: EmbedIntoVocabulary<V>> EmbedIntoVocabulary<V> for Term<I, L>
impl<V, I: EmbedIntoVocabulary<V>, L: EmbedIntoVocabulary<V>> EmbedIntoVocabulary<V> for Term<I, L>
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) -> Self::Embedded
Source§impl<V, I: EmbeddedIntoVocabulary<V>, L: EmbeddedIntoVocabulary<V>> EmbeddedIntoVocabulary<V> for Term<I, L>
impl<V, I: EmbeddedIntoVocabulary<V>, L: EmbeddedIntoVocabulary<V>> EmbeddedIntoVocabulary<V> for Term<I, L>
type Embedded = Term<<I as EmbeddedIntoVocabulary<V>>::Embedded, <L as EmbeddedIntoVocabulary<V>>::Embedded>
fn embedded_into_vocabulary(&self, vocabulary: &mut V) -> Self::Embedded
Source§impl<V: LiteralVocabulary, I: ExtractFromVocabulary<V>> ExtractFromVocabulary<V> for Term<I, V::Literal>
impl<V: LiteralVocabulary, I: ExtractFromVocabulary<V>> ExtractFromVocabulary<V> for Term<I, V::Literal>
Source§impl<V: LiteralVocabulary, I: ExtractedFromVocabulary<V>> ExtractedFromVocabulary<V> for Term<I, V::Literal>
impl<V: LiteralVocabulary, I: ExtractedFromVocabulary<V>> ExtractedFromVocabulary<V> for Term<I, V::Literal>
Source§impl<V: Vocabulary> From<Term<Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId>, <V as LiteralVocabulary>::Literal>> for Resource<V>
impl<V: Vocabulary> From<Term<Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId>, <V as LiteralVocabulary>::Literal>> for Resource<V>
Source§fn from(
value: Term<Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId>, <V as LiteralVocabulary>::Literal>,
) -> Self
fn from( value: Term<Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId>, <V as LiteralVocabulary>::Literal>, ) -> Self
Converts to this type from the input type.
Source§impl<I: FromBlankId, L> FromBlankId for Term<I, L>
impl<I: FromBlankId, L> FromBlankId for Term<I, L>
Source§fn from_blank(b: Self::BlankId) -> Self
fn from_blank(b: Self::BlankId) -> Self
Builds a value from a blank node identifier.
Source§impl<I: LiteralInterpretationMut<L>, T: Interpret<I, Interpreted = I::Resource>, L> Interpret<I> for Term<T, L>
impl<I: LiteralInterpretationMut<L>, T: Interpret<I, Interpreted = I::Resource>, L> Interpret<I> for Term<T, L>
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<I: MaybeBlankId, L> MaybeBlankId for Term<I, L>
impl<I: MaybeBlankId, L> MaybeBlankId for Term<I, L>
Source§type BlankId = <I as MaybeBlankId>::BlankId
type BlankId = <I as MaybeBlankId>::BlankId
Inner blank node identifier type.
Source§impl<I: Ord, L: Ord> Ord for Term<I, L>
impl<I: Ord, L: Ord> 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: PartialOrd<I2>, L1: PartialOrd<L2>, I2, L2> PartialOrd<Term<I2, L2>> for Term<I1, L1>
impl<I1: PartialOrd<I2>, L1: PartialOrd<L2>, I2, L2> PartialOrd<Term<I2, L2>> for Term<I1, L1>
Source§impl<I: RdfDisplay, L: RdfDisplay> RdfDisplay for Term<I, L>
impl<I: RdfDisplay, L: RdfDisplay> RdfDisplay for Term<I, L>
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<I: TryAsBlankId, L> TryAsBlankId for Term<I, L>
impl<I: TryAsBlankId, L> TryAsBlankId for Term<I, L>
Source§impl<V, I: TryExtractFromVocabulary<V>, L: TryExtractFromVocabulary<V>> TryExtractFromVocabulary<V> for Term<I, L>
impl<V, I: TryExtractFromVocabulary<V>, L: TryExtractFromVocabulary<V>> TryExtractFromVocabulary<V> for Term<I, L>
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<Self::Extracted, Self::Error>
Source§impl<I: TryIntoBlankId, L> TryIntoBlankId for Term<I, L>
impl<I: TryIntoBlankId, L> TryIntoBlankId for Term<I, L>
fn try_into_blank(self) -> Result<Self::BlankId, Self>
Source§impl<I: TryIntoIri, L> TryIntoIri for Term<I, L>
impl<I: TryIntoIri, L> TryIntoIri for Term<I, L>
fn try_into_iri(self) -> Result<Self::Iri, Self>
impl<I: Copy, L: Copy> Copy for Term<I, L>
impl<I: Eq, L: Eq> 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> 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.