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: AsBlankId,
pub fn is_iri(&self) -> boolwhere I: AsIri,
pub fn as_blank(&self) -> Option<&I::BlankId>where I: AsBlankId,
pub fn try_into_blank(self) -> Result<I::BlankId, Self>where I: IntoBlankId,
pub fn into_blank(self) -> Option<I::BlankId>where I: IntoBlankId,
pub fn as_iri(&self) -> Option<&I::Iri>where I: AsIri,
pub fn try_into_iri(self) -> Result<I::Iri, Self>where I: IntoIri,
pub fn into_iri(self) -> Option<I::Iri>where I: IntoIri,
source§impl<L> Term<Id, L>
impl<L> Term<Id, L>
pub fn as_term_ref(&self) -> TermRef<'_, L>
sourcepub fn as_object_ref(&self) -> ObjectRef<'_, L>
pub fn as_object_ref(&self) -> ObjectRef<'_, L>
Alias for as_term_ref
.
Trait Implementations§
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<V, I: InsertIntoVocabulary<V>, L: InsertIntoVocabulary<V>> InsertIntoVocabulary<V> for Term<I, L>
impl<V, I: InsertIntoVocabulary<V>, L: InsertIntoVocabulary<V>> InsertIntoVocabulary<V> for Term<I, L>
type Inserted = Term<<I as InsertIntoVocabulary<V>>::Inserted, <L as InsertIntoVocabulary<V>>::Inserted>
fn insert_into_vocabulary(self, vocabulary: &mut V) -> Self::Inserted
source§impl<V, I: InsertedIntoVocabulary<V>, L: InsertedIntoVocabulary<V>> InsertedIntoVocabulary<V> for Term<I, L>
impl<V, I: InsertedIntoVocabulary<V>, L: InsertedIntoVocabulary<V>> InsertedIntoVocabulary<V> for Term<I, L>
type Inserted = Term<<I as InsertedIntoVocabulary<V>>::Inserted, <L as InsertedIntoVocabulary<V>>::Inserted>
fn inserted_into_vocabulary(&self, vocabulary: &mut V) -> Self::Inserted
source§impl<I: IntoBlankId, L> IntoBlankId for Term<I, L>
impl<I: IntoBlankId, L> IntoBlankId for Term<I, L>
fn try_into_blank(self) -> Result<Self::BlankId, Self>
source§fn into_blank(self) -> Option<Self::BlankId>
fn into_blank(self) -> Option<Self::BlankId>
Converts the value into a blank node identifier, if any.
source§impl<I, T, U> MapLiteral<T, U> for Term<I, T>
impl<I, T, U> MapLiteral<T, U> for Term<I, T>
source§impl<I: MaybeBlankId, L> MaybeBlankId for Term<I, L>
impl<I: MaybeBlankId, L> MaybeBlankId for Term<I, L>
§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: PartialEq<I2>, L1: PartialEq<L2>, I2, L2> PartialEq<Term<I2, L2>> for Term<I1, L1>
impl<I1: PartialEq<I2>, L1: PartialEq<L2>, I2, L2> PartialEq<Term<I2, L2>> for Term<I1, L1>
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>
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, L: RdfDisplay> RdfDisplay for Term<I, L>
impl<I: RdfDisplay, L: RdfDisplay> RdfDisplay for Term<I, L>
fn rdf_fmt(&self, f: &mut Formatter<'_>) -> Result
fn rdf_display(&self) -> RdfDisplayed<&Self>
source§impl<V, I: TryExportFromVocabulary<V>, L: TryExportFromVocabulary<V>> TryExportFromVocabulary<V> for Term<I, L>
impl<V, I: TryExportFromVocabulary<V>, L: TryExportFromVocabulary<V>> TryExportFromVocabulary<V> for Term<I, L>
type Output = Term<<I as TryExportFromVocabulary<V>>::Output, <L as TryExportFromVocabulary<V>>::Output>
type Error = Term<<I as TryExportFromVocabulary<V>>::Error, <L as TryExportFromVocabulary<V>>::Error>
fn try_export_from_vocabulary( self, vocabulary: &V ) -> Result<Self::Output, Self::Error>
impl<I: Copy, L: Copy> Copy for Term<I, L>
impl<I: Eq, L: Eq> Eq for Term<I, L>
impl<I, L> StructuralEq for Term<I, L>
Auto Trait Implementations§
impl<I, L> RefUnwindSafe for Term<I, L>where I: RefUnwindSafe, L: RefUnwindSafe,
impl<I, L> Send for Term<I, L>where I: Send, L: Send,
impl<I, L> Sync for Term<I, L>where I: Sync, L: Sync,
impl<I, L> Unpin for Term<I, L>where I: Unpin, L: Unpin,
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.