Enum json_ld_core::id::ValidId
source · pub enum ValidId<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<&Id<I, B>, &L>
pub fn as_term<L>(&self) -> Term<&Id<I, B>, &L>
Converts this id reference into the term Term::Id(&id)
.
source§impl Id
impl Id
sourcepub fn as_subject_ref(&self) -> Id<Iri<'_>, &BlankId>
pub fn as_subject_ref(&self) -> Id<Iri<'_>, &BlankId>
Alias for as_id_ref
.
sourcepub fn as_graph_label_ref(&self) -> Id<Iri<'_>, &BlankId>
pub fn as_graph_label_ref(&self) -> Id<Iri<'_>, &BlankId>
Alias for as_id_ref
.
pub fn inserted_into<V>(
&self,
vocabulary: &mut V
) -> Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId>where
V: VocabularyMut,
pub fn insert_into<V>(
self,
vocabulary: &mut V
) -> Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId>where
V: VocabularyMut,
Trait Implementations§
source§impl<I, B, V> AsRefWithContext<str, V> for Id<I, B>where
V: Vocabulary<Iri = I, BlankId = B>,
impl<I, B, V> AsRefWithContext<str, V> for Id<I, B>where
V: Vocabulary<Iri = I, BlankId = B>,
fn as_ref_with<'a>(&'a self, vocabulary: &'a V) -> &'a str
source§impl<I, B, V> DisplayWithContext<V> for Id<I, B>where
V: Vocabulary<Iri = I, BlankId = B>,
impl<I, B, V> DisplayWithContext<V> for Id<I, B>where
V: Vocabulary<Iri = I, BlankId = B>,
source§impl<I, B> FromBlankId for Id<I, B>
impl<I, B> FromBlankId for Id<I, B>
source§fn from_blank(b: <Id<I, B> as MaybeBlankId>::BlankId) -> Id<I, B>
fn from_blank(b: <Id<I, B> as MaybeBlankId>::BlankId) -> Id<I, B>
Builds a value from a blank node identifier.
source§impl<I, B, T> IdInterpretation<Id<I, B>> for Twhere
T: IriInterpretation<I> + BlankIdInterpretation<B>,
impl<I, B, T> IdInterpretation<Id<I, B>> for Twhere
T: IriInterpretation<I> + BlankIdInterpretation<B>,
source§fn id_interpretation(
&self,
id: &Id<I, B>
) -> Option<<T as Interpretation>::Resource>
fn id_interpretation( &self, id: &Id<I, B> ) -> Option<<T as Interpretation>::Resource>
Returns the interpretation of the given node identifier, if any.
source§impl<I, B, T> IdInterpretationMut<Id<I, B>> for Twhere
T: IriInterpretationMut<I> + BlankIdInterpretationMut<B>,
impl<I, B, T> IdInterpretationMut<Id<I, B>> for Twhere
T: IriInterpretationMut<I> + BlankIdInterpretationMut<B>,
source§fn interpret_id(&mut self, id: Id<I, B>) -> <T as Interpretation>::Resource
fn interpret_id(&mut self, id: Id<I, B>) -> <T as Interpretation>::Resource
Interprets the given identifier.
source§impl<V, I, B> InsertIntoVocabulary<V> for Id<I, B>where
I: InsertIntoVocabulary<V>,
B: InsertIntoVocabulary<V>,
impl<V, I, B> InsertIntoVocabulary<V> for Id<I, B>where
I: InsertIntoVocabulary<V>,
B: InsertIntoVocabulary<V>,
type Inserted = Id<<I as InsertIntoVocabulary<V>>::Inserted, <B as InsertIntoVocabulary<V>>::Inserted>
fn insert_into_vocabulary( self, vocabulary: &mut V ) -> <Id<I, B> as InsertIntoVocabulary<V>>::Inserted
source§impl<V, I, B> InsertedIntoVocabulary<V> for Id<I, B>where
I: InsertedIntoVocabulary<V>,
B: InsertedIntoVocabulary<V>,
impl<V, I, B> InsertedIntoVocabulary<V> for Id<I, B>where
I: InsertedIntoVocabulary<V>,
B: InsertedIntoVocabulary<V>,
type Inserted = Id<<I as InsertedIntoVocabulary<V>>::Inserted, <B as InsertedIntoVocabulary<V>>::Inserted>
fn inserted_into_vocabulary( &self, vocabulary: &mut V ) -> <Id<I, B> as InsertedIntoVocabulary<V>>::Inserted
source§impl<I, B, T> Interpret<T> for Id<I, B>where
T: IdInterpretationMut<Id<I, B>>,
impl<I, B, T> Interpret<T> for Id<I, B>where
T: IdInterpretationMut<Id<I, B>>,
§type Interpreted = <T as Interpretation>::Resource
type Interpreted = <T as Interpretation>::Resource
Interpreted form.
source§impl<I, B> IntoBlankId for Id<I, B>
impl<I, B> IntoBlankId for Id<I, B>
fn try_into_blank(self) -> Result<<Id<I, B> as MaybeBlankId>::BlankId, Id<I, B>>
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, B, T, U> MapLiteral<T, U> for Id<I, B>
impl<I, B, T, U> MapLiteral<T, U> for Id<I, B>
type Output = Id<I, B>
source§fn map_literal(
self,
_f: impl FnMut(T) -> U
) -> <Id<I, B> as MapLiteral<T, U>>::Output
fn map_literal( self, _f: impl FnMut(T) -> U ) -> <Id<I, B> as MapLiteral<T, U>>::Output
Maps RDF literal values.
source§impl<I, B> Ord for Id<I, B>
impl<I, B> Ord for Id<I, B>
source§impl<I1, B1, I2, B2> PartialEq<Id<I2, B2>> for Id<I1, B1>
impl<I1, B1, I2, B2> PartialEq<Id<I2, B2>> for Id<I1, B1>
source§impl<I1, B1, I2, B2> PartialOrd<Id<I2, B2>> for Id<I1, B1>where
I1: PartialOrd<I2>,
B1: PartialOrd<B2>,
impl<I1, B1, I2, B2> PartialOrd<Id<I2, B2>> for Id<I1, B1>where
I1: PartialOrd<I2>,
B1: PartialOrd<B2>,
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, B> RdfDisplay for Id<I, B>
impl<I, B> RdfDisplay for Id<I, B>
source§impl<I, B, V> RdfDisplayWithContext<V> for Id<I, B>where
V: Vocabulary<Iri = I, BlankId = B>,
impl<I, B, V> RdfDisplayWithContext<V> for Id<I, B>where
V: Vocabulary<Iri = I, BlankId = B>,
source§impl<I, B> StrippedHash for Id<I, B>
impl<I, B> StrippedHash for Id<I, B>
fn stripped_hash<H>(&self, state: &mut H)where
H: Hasher,
source§impl<I, B> StrippedOrd for Id<I, B>
impl<I, B> StrippedOrd for Id<I, B>
fn stripped_cmp(&self, other: &Id<I, B>) -> Ordering
source§impl<I, B, __I, __B> StrippedPartialEq<Id<__I, __B>> for Id<I, B>
impl<I, B, __I, __B> StrippedPartialEq<Id<__I, __B>> for Id<I, B>
fn stripped_eq(&self, other: &Id<__I, __B>) -> bool
source§impl<I, B, __I, __B> StrippedPartialOrd<Id<__I, __B>> for Id<I, B>where
I: PartialOrd<__I>,
B: PartialOrd<__B>,
impl<I, B, __I, __B> StrippedPartialOrd<Id<__I, __B>> for Id<I, B>where
I: PartialOrd<__I>,
B: PartialOrd<__B>,
impl<I, B> Copy for Id<I, B>
impl<I, B> Eq for Id<I, B>
impl<I, B> StrippedEq for Id<I, B>
impl<I, B> StructuralEq for Id<I, B>
Auto Trait Implementations§
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
§impl<T> CallHasher for T
impl<T> CallHasher for T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
fn equivalent(&self, key: &K) -> bool
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.