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_lexical_id_ref(&self) -> Id<&Iri, &BlankId>
pub fn as_lexical_id_ref(&self) -> Id<&Iri, &BlankId>
Turns this reference into an IdRef
.
Sourcepub fn as_lexical_subject_ref(&self) -> Id<&Iri, &BlankId>
pub fn as_lexical_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<V> AsRefWithContext<str, V> for Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId>where
V: IriVocabulary + BlankIdVocabulary,
impl<V> AsRefWithContext<str, V> for Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId>where
V: IriVocabulary + BlankIdVocabulary,
fn as_ref_with<'a>(&'a self, vocabulary: &'a V) -> &'a str
Source§impl<V> DisplayWithContext<V> for Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId>where
V: IriVocabulary + BlankIdVocabulary,
impl<V> DisplayWithContext<V> for Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId>where
V: IriVocabulary + BlankIdVocabulary,
Source§impl<V, I, B> EmbedIntoVocabulary<V> for Id<I, B>where
I: EmbedIntoVocabulary<V>,
B: EmbedIntoVocabulary<V>,
impl<V, I, B> EmbedIntoVocabulary<V> for Id<I, B>where
I: EmbedIntoVocabulary<V>,
B: EmbedIntoVocabulary<V>,
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, ) -> <Id<I, B> as EmbedIntoVocabulary<V>>::Embedded
Source§impl<V, I, B> EmbeddedIntoVocabulary<V> for Id<I, B>where
I: EmbeddedIntoVocabulary<V>,
B: EmbeddedIntoVocabulary<V>,
impl<V, I, B> EmbeddedIntoVocabulary<V> for Id<I, B>where
I: EmbeddedIntoVocabulary<V>,
B: EmbeddedIntoVocabulary<V>,
type Embedded = Id<<I as EmbeddedIntoVocabulary<V>>::Embedded, <B as EmbeddedIntoVocabulary<V>>::Embedded>
fn embedded_into_vocabulary( &self, vocabulary: &mut V, ) -> <Id<I, B> as EmbeddedIntoVocabulary<V>>::Embedded
Source§impl<I, B> Equivalent<Id<I, B>> for Id<I, B>
impl<I, B> Equivalent<Id<I, B>> for Id<I, B>
Source§fn equivalent(&self, key: &Id<I, B>) -> bool
fn equivalent(&self, key: &Id<I, B>) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<V> ExtractFromVocabulary<V> for Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId>where
V: IriVocabulary + BlankIdVocabulary,
impl<V> ExtractFromVocabulary<V> for Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId>where
V: IriVocabulary + BlankIdVocabulary,
type Extracted = Id
fn extract_from_vocabulary( self, vocabulary: &V, ) -> <Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId> as ExtractFromVocabulary<V>>::Extracted
Source§impl<V> ExtractedFromVocabulary<V> for Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId>where
V: IriVocabulary + BlankIdVocabulary,
impl<V> ExtractedFromVocabulary<V> for Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId>where
V: IriVocabulary + BlankIdVocabulary,
type Extracted = Id
Source§fn extracted_from_vocabulary(
&self,
vocabulary: &V,
) -> <Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId> as ExtractedFromVocabulary<V>>::Extracted
fn extracted_from_vocabulary( &self, vocabulary: &V, ) -> <Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId> as ExtractedFromVocabulary<V>>::Extracted
Exports a value embedded into the vocabulary
V
. Read moreSource§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> Interpret<T> for Id<I, B>where
T: IdInterpretationMut<I, B>,
impl<I, B, T> Interpret<T> for Id<I, B>where
T: IdInterpretationMut<I, B>,
Source§type Interpreted = <T as Interpretation>::Resource
type Interpreted = <T as Interpretation>::Resource
Interpreted form.
Source§impl<I, V> LinkedDataDeserializePredicateObjects<I, V> for Idwhere
I: Interpretation + ReverseIdInterpretation<Iri = <V as IriVocabulary>::Iri, BlankId = <V as BlankIdVocabulary>::BlankId>,
V: Vocabulary,
impl<I, V> LinkedDataDeserializePredicateObjects<I, V> for Idwhere
I: Interpretation + ReverseIdInterpretation<Iri = <V as IriVocabulary>::Iri, BlankId = <V as BlankIdVocabulary>::BlankId>,
V: Vocabulary,
fn deserialize_objects_in<'a, D>(
vocabulary: &V,
interpretation: &I,
dataset: &D,
graph: Option<&<I as Interpretation>::Resource>,
objects: impl IntoIterator<Item = &'a <I as Interpretation>::Resource>,
context: Context<'_, I>,
) -> Result<Id, FromLinkedDataError>where
<I as Interpretation>::Resource: 'a,
D: PatternMatchingDataset<Resource = <I as Interpretation>::Resource>,
fn deserialize_objects<'a, D>(
vocabulary: &V,
interpretation: &I,
dataset: &D,
graph: Option<&<I as Interpretation>::Resource>,
objects: impl IntoIterator<Item = &'a <I as Interpretation>::Resource>,
) -> Result<Self, FromLinkedDataError>where
<I as Interpretation>::Resource: 'a,
D: PatternMatchingDataset<Resource = <I as Interpretation>::Resource>,
Source§impl<I, V> LinkedDataDeserializeSubject<I, V> for Idwhere
I: Interpretation + ReverseIdInterpretation<Iri = <V as IriVocabulary>::Iri, BlankId = <V as BlankIdVocabulary>::BlankId>,
V: Vocabulary,
impl<I, V> LinkedDataDeserializeSubject<I, V> for Idwhere
I: Interpretation + ReverseIdInterpretation<Iri = <V as IriVocabulary>::Iri, BlankId = <V as BlankIdVocabulary>::BlankId>,
V: Vocabulary,
fn deserialize_subject_in<D>( vocabulary: &V, interpretation: &I, _dataset: &D, _graph: Option<&<I as Interpretation>::Resource>, resource: &<I as Interpretation>::Resource, context: Context<'_, I>, ) -> Result<Id, FromLinkedDataError>
fn deserialize_subject<D>( vocabulary: &V, interpretation: &I, dataset: &D, graph: Option<&<I as Interpretation>::Resource>, resource: &<I as Interpretation>::Resource, ) -> Result<Self, FromLinkedDataError>
Source§impl<I, V, T, B> LinkedDataPredicateObjects<I, V> for Id<T, B>where
I: Interpretation,
V: Vocabulary,
T: LinkedDataPredicateObjects<I, V>,
B: LinkedDataPredicateObjects<I, V>,
impl<I, V, T, B> LinkedDataPredicateObjects<I, V> for Id<T, B>where
I: Interpretation,
V: Vocabulary,
T: LinkedDataPredicateObjects<I, V>,
B: LinkedDataPredicateObjects<I, V>,
fn visit_objects<S>(
&self,
visitor: S,
) -> Result<<S as PredicateObjectsVisitor<I, V>>::Ok, <S as PredicateObjectsVisitor<I, V>>::Error>where
S: PredicateObjectsVisitor<I, V>,
Source§impl<V, I, T, B> LinkedDataResource<I, V> for Id<T, B>
impl<V, I, T, B> LinkedDataResource<I, V> for Id<T, B>
fn interpretation( &self, vocabulary: &mut V, interpretation: &mut I, ) -> ResourceInterpretation<'_, I, V>
fn lexical_representation<'a>(
&'a self,
vocabulary: &'a mut V,
interpretation: &'a mut I,
) -> Option<CowRdfTerm<'a, V>>where
I: ReverseTermInterpretation<Iri = <V as IriVocabulary>::Iri, BlankId = <V as BlankIdVocabulary>::BlankId, Literal = <V as LiteralVocabulary>::Literal>,
fn reference_interpretation( &self, vocabulary: &mut V, interpretation: &mut I, ) -> ResourceInterpretation<'_, I, V>
Source§impl<I, V, T, B> LinkedDataSubject<I, V> for Id<T, B>
impl<I, V, T, B> LinkedDataSubject<I, V> for Id<T, B>
fn visit_subject<S>(
&self,
serializer: S,
) -> Result<<S as SubjectVisitor<I, V>>::Ok, <S as SubjectVisitor<I, V>>::Error>where
S: SubjectVisitor<I, V>,
Source§impl<I, B> Ord for Id<I, B>
impl<I, B> Ord for Id<I, B>
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>,
Source§impl<I, B> RdfDisplay for Id<I, B>
impl<I, B> RdfDisplay for Id<I, B>
Source§impl<V> RdfDisplayWithContext<V> for Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId>where
V: IriVocabulary + BlankIdVocabulary,
impl<V> RdfDisplayWithContext<V> for Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId>where
V: IriVocabulary + BlankIdVocabulary,
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<<Id<I, B> as MaybeBlankId>::BlankId, Id<I, B>>
Source§impl<I, B> TryIntoIri for Id<I, B>
impl<I, B> TryIntoIri for Id<I, B>
fn try_into_iri(self) -> Result<I, Id<I, B>>
impl<I, B> Copy for Id<I, B>
impl<I, B> 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> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<T>
Source§impl<T> CallHasher for T
impl<T> CallHasher for T
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.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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.