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
Sourcepub fn as_lexical_id_ref(&self) -> LexicalIdRef<'_>
pub fn as_lexical_id_ref(&self) -> LexicalIdRef<'_>
Turns this reference into an IdRef
.
Sourcepub fn as_lexical_subject_ref(&self) -> LexicalSubjectRef<'_>
pub fn as_lexical_subject_ref(&self) -> LexicalSubjectRef<'_>
Alias for as_id_ref
.
Sourcepub fn as_graph_label_ref(&self) -> LexicalGraphLabelRef<'_>
pub fn as_graph_label_ref(&self) -> LexicalGraphLabelRef<'_>
Alias for as_id_ref
.
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<V, I: EmbedIntoVocabulary<V>, B: EmbedIntoVocabulary<V>> EmbedIntoVocabulary<V> for Id<I, B>
impl<V, I: EmbedIntoVocabulary<V>, B: EmbedIntoVocabulary<V>> EmbedIntoVocabulary<V> for Id<I, B>
Source§type Embedded = Id<<I as EmbedIntoVocabulary<V>>::Embedded, <B as EmbedIntoVocabulary<V>>::Embedded>
type Embedded = Id<<I as EmbedIntoVocabulary<V>>::Embedded, <B 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>, B: EmbeddedIntoVocabulary<V>> EmbeddedIntoVocabulary<V> for Id<I, B>
impl<V, I: EmbeddedIntoVocabulary<V>, B: EmbeddedIntoVocabulary<V>> EmbeddedIntoVocabulary<V> for Id<I, B>
type Embedded = Id<<I as EmbeddedIntoVocabulary<V>>::Embedded, <B as EmbeddedIntoVocabulary<V>>::Embedded>
fn embedded_into_vocabulary(&self, vocabulary: &mut V) -> Self::Embedded
Source§impl<V: IriVocabulary + BlankIdVocabulary> ExtractFromVocabulary<V> for Id<V::Iri, V::BlankId>
impl<V: IriVocabulary + BlankIdVocabulary> ExtractFromVocabulary<V> for Id<V::Iri, V::BlankId>
Source§impl<V: IriVocabulary + BlankIdVocabulary> ExtractedFromVocabulary<V> for Id<V::Iri, V::BlankId>
impl<V: IriVocabulary + BlankIdVocabulary> ExtractedFromVocabulary<V> for Id<V::Iri, V::BlankId>
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, T: IdInterpretationMut<I, B>> Interpret<T> for Id<I, B>
impl<I, B, T: IdInterpretationMut<I, B>> Interpret<T> for Id<I, B>
Source§type Interpreted = <T as Interpretation>::Resource
type Interpreted = <T as Interpretation>::Resource
Interpreted form.
Source§fn interpret(self, interpretation: &mut T) -> Self::Interpreted
fn interpret(self, interpretation: &mut T) -> Self::Interpreted
Interpret the given resource.
Source§impl<I: Ord, B: Ord> Ord for Id<I, B>
impl<I: Ord, B: Ord> Ord for Id<I, B>
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>
Source§impl<I: Display, B: Display> RdfDisplay for Id<I, B>
impl<I: Display, B: Display> RdfDisplay for Id<I, B>
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, B> TryAsBlankId for Id<I, B>
impl<I, B> TryAsBlankId for Id<I, B>
Source§impl<I, B> TryIntoBlankId for Id<I, B>
impl<I, B> TryIntoBlankId for Id<I, B>
fn try_into_blank(self) -> Result<Self::BlankId, Self>
Source§impl<I, B> TryIntoIri for Id<I, B>
impl<I, B> TryIntoIri for Id<I, B>
fn try_into_iri(self) -> Result<I, Self>
impl<I: Copy, B: Copy> Copy for Id<I, B>
impl<I: Eq, B: Eq> Eq for Id<I, B>
Auto Trait Implementations§
impl<I, B> Freeze for Id<I, B>
impl<I, B> RefUnwindSafe for Id<I, B>where
B: RefUnwindSafe,
I: RefUnwindSafe,
impl<I, B> Send for Id<I, B>
impl<I, B> Sync for Id<I, B>
impl<I, B> Unpin for Id<I, B>
impl<I, B> UnwindSafe for Id<I, B>where
B: UnwindSafe,
I: 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.