pub enum Id<I = IriBuf, B = BlankIdBuf> {
Blank(B),
Iri(I),
}
Expand description
RDF node identifier.
Either a blank node identifier or an IRI.
Hash
implementation
It is guaranteed that the Hash
implementation of Id
is
transparent, meaning that the hash of Term::Blank(id)
the same as id
and the hash of Subject::Iri(iri)
is the same as iri
.
Variants§
Implementations§
source§impl<I, B> Id<I, B>
impl<I, B> Id<I, B>
pub fn is_blank(&self) -> bool
pub fn is_iri(&self) -> bool
pub fn as_blank(&self) -> Option<&B>
pub fn as_iri(&self) -> Option<&I>
pub fn try_into_blank(self) -> Result<B, I>
pub fn into_blank(self) -> Option<B>
pub fn try_into_iri(self) -> Result<I, B>
pub fn into_iri(self) -> Option<I>
sourcepub fn as_term<L>(&self) -> Term<&Self, &L>
pub fn as_term<L>(&self) -> Term<&Self, &L>
Converts this id reference into the term Term::Id(&id)
.
source§impl Id
impl Id
pub fn inserted_into<V: VocabularyMut>( &self, vocabulary: &mut V ) -> Id<V::Iri, V::BlankId>
pub fn insert_into<V: VocabularyMut>( self, vocabulary: &mut V ) -> Id<V::Iri, V::BlankId>
Trait Implementations§
source§impl<I, B> FromBlankId for Id<I, B>
impl<I, B> FromBlankId for Id<I, B>
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, B> IntoBlankId for Id<I, B>
impl<I, B> IntoBlankId for Id<I, B>
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: Ord, B: Ord> Ord for Id<I, B>
impl<I: Ord, B: Ord> Ord for Id<I, B>
source§impl<I1: PartialEq<I2>, B1: PartialEq<B2>, I2, B2> PartialEq<Id<I2, B2>> for Id<I1, B1>
impl<I1: PartialEq<I2>, B1: PartialEq<B2>, I2, B2> PartialEq<Id<I2, B2>> for Id<I1, B1>
source§impl<I1: PartialOrd<I2>, B1: PartialOrd<B2>, I2, B2> PartialOrd<Id<I2, B2>> for Id<I1, B1>
impl<I1: PartialOrd<I2>, B1: PartialOrd<B2>, I2, B2> PartialOrd<Id<I2, B2>> for Id<I1, B1>
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 more