Enum 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§

§

Blank(B)

Blank node identifier.

§

Iri(I)

IRI.

Implementations§

Source§

impl<I, B> Id<I, B>

Source

pub fn is_blank(&self) -> bool

Source

pub fn is_iri(&self) -> bool

Source

pub fn as_blank(&self) -> Option<&B>

Source

pub fn as_iri(&self) -> Option<&I>

Source

pub fn try_into_blank(self) -> Result<B, I>

Source

pub fn into_blank(self) -> Option<B>

Source

pub fn try_into_iri(self) -> Result<I, B>

Source

pub fn into_iri(self) -> Option<I>

Source

pub fn as_term<L>(&self) -> Term<&Id<I, B>, &L>

Converts this id reference into the term Term::Id(&id).

Source

pub fn into_term<L>(self) -> Term<Id<I, B>, L>

Converts the id into the term Term::Id(id).

Source

pub fn as_str(&self) -> &str
where I: AsRef<str>, B: AsRef<str>,

Returns a borrowed string representation of the id.

Source

pub fn as_ref(&self) -> Id<&I, &B>

Converts an &Id<I, B> into an Id<&I, &B>.

Source§

impl<'a, I, B> Id<&'a I, &'a B>

Source

pub fn cloned(self) -> Id<I, B>
where I: Clone, B: Clone,

Maps an Id<&I, &B> into an Id<I, B> by cloning the contents of the id.

Source

pub fn copied(self) -> Id<I, B>
where I: Copy, B: Copy,

Maps an Id<&I, &B> into an Id<I, B> by copying the contents of the id.

Source§

impl Id

Source

pub fn as_lexical_id_ref(&self) -> Id<&Iri, &BlankId>

Turns this reference into an IdRef.

Source

pub fn as_lexical_subject_ref(&self) -> Id<&Iri, &BlankId>

Alias for as_id_ref.

Source

pub fn as_graph_label_ref(&self) -> Id<&Iri, &BlankId>

Alias for as_id_ref.

Source

pub fn inserted_into<V>( &self, vocabulary: &mut V, ) -> Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId>
where V: VocabularyMut,

Source

pub fn insert_into<V>( self, vocabulary: &mut V, ) -> Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId>
where V: VocabularyMut,

Source§

impl Id<&Iri, &BlankId>

Source

pub fn into_owned(self) -> Id

Trait Implementations§

Source§

impl<I, B> AsId for Id<I, B>

Source§

fn as_id(&self) -> Id<&I, &B>

Source§

impl<I, B, L> AsRdfTerm<I, B, L> for Id<I, B>

Source§

fn as_rdf_term(&self) -> Term<Id<&I, &B>, &L>

Returns this value as an RDF term.
Source§

impl<V> AsRefWithContext<str, V> for Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId>

Source§

fn as_ref_with<'a>(&'a self, vocabulary: &'a V) -> &'a str

Source§

impl<I, B> Clone for Id<I, B>
where I: Clone, B: Clone,

Source§

fn clone(&self) -> Id<I, B>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<I, B> Debug for Id<I, B>
where I: Debug, B: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<I, B> Display for Id<I, B>
where I: Display, B: Display,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<V> DisplayWithContext<V> for Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId>

Source§

fn fmt_with(&self, vocabulary: &V, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl<V, I, B> EmbedIntoVocabulary<V> for Id<I, B>

Source§

type Embedded = Id<<I as EmbedIntoVocabulary<V>>::Embedded, <B as EmbedIntoVocabulary<V>>::Embedded>

Type of the value once embedded into the vocabulary.
Source§

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>

Source§

impl<I, B> Equivalent<Id<I, B>> for Id<I, B>
where I: PartialEq, B: PartialEq,

Source§

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>

Source§

impl<V> ExtractedFromVocabulary<V> for Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId>

Source§

type Extracted = Id

Source§

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 more
Source§

impl<T, B> From<Id<T, B>> for Id<T, B>

Source§

fn from(r: Id<T, B>) -> Id<T, B>

Converts to this type from the input type.
Source§

impl<I, B> FromBlankId for Id<I, B>

Source§

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> FromIri for Id<I, B>

Source§

fn from_iri(b: I) -> Id<I, B>

Builds a value from an iri.
Source§

impl<I, B> Hash for Id<I, B>
where I: Hash, B: Hash,

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<I, B, T> Interpret<T> for Id<I, B>
where T: IdInterpretationMut<I, B>,

Source§

type Interpreted = <T as Interpretation>::Resource

Interpreted form.
Source§

fn interpret( self, interpretation: &mut T, ) -> <Id<I, B> as Interpret<T>>::Interpreted

Interpret the given resource.
Source§

impl<I, B> IntoId for Id<I, B>

Source§

fn into_id(self) -> Id<I, B>

Source§

impl<I, V> LinkedDataDeserializePredicateObjects<I, V> for Id

Source§

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>,

Source§

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 Id

Source§

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>
where D: PatternMatchingDataset<Resource = <I as Interpretation>::Resource>,

Source§

fn deserialize_subject<D>( vocabulary: &V, interpretation: &I, dataset: &D, graph: Option<&<I as Interpretation>::Resource>, resource: &<I as Interpretation>::Resource, ) -> Result<Self, FromLinkedDataError>
where D: PatternMatchingDataset<Resource = <I as Interpretation>::Resource>,

Source§

impl<I, V, T, B> LinkedDataPredicateObjects<I, V> for Id<T, B>

Source§

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>

Source§

fn interpretation( &self, vocabulary: &mut V, interpretation: &mut I, ) -> ResourceInterpretation<'_, I, V>

Source§

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>,

Source§

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>

Source§

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<T, B> MappedEq for Id<T, B>
where T: PartialEq, B: PartialEq,

Source§

type BlankId = B

Source§

fn mapped_eq<'a, 'b, F>(&'a self, other: &Id<T, B>, f: F) -> bool
where F: Clone + Fn(&'a <Id<T, B> as MappedEq>::BlankId) -> &'b <Id<T, B> as MappedEq>::BlankId, <Id<T, B> as MappedEq>::BlankId: 'a + 'b,

Structural equality with mapped blank identifiers. Read more
Source§

impl<I, B> MaybeBlankId for Id<I, B>

Source§

type BlankId = B

Inner blank node identifier type.
Source§

impl<I, B> MaybeIri for Id<I, B>

Source§

type Iri = I

Inner iri type.
Source§

impl<I, B> Ord for Id<I, B>
where I: Ord, B: Ord,

Source§

fn cmp(&self, other: &Id<I, B>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<I1, B1, I2, B2> PartialEq<Id<I2, B2>> for Id<I1, B1>
where I1: PartialEq<I2>, B1: PartialEq<B2>,

Source§

fn eq(&self, other: &Id<I2, B2>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<I1, B1, I2, B2> PartialOrd<Id<I2, B2>> for Id<I1, B1>
where I1: PartialOrd<I2>, B1: PartialOrd<B2>,

Source§

fn partial_cmp(&self, other: &Id<I2, B2>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<I, B> RdfDisplay for Id<I, B>
where I: Display, B: Display,

Source§

fn rdf_fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter.
Source§

fn rdf_display(&self) -> RdfDisplayed<&Self>

Prepare the value to be formatted as an RDF syntax element.
Source§

impl<V> RdfDisplayWithContext<V> for Id<<V as IriVocabulary>::Iri, <V as BlankIdVocabulary>::BlankId>

Source§

fn rdf_fmt_with( &self, vocabulary: &V, f: &mut Formatter<'_>, ) -> Result<(), Error>

Source§

impl<I, B> TryAsBlankId for Id<I, B>

Source§

fn try_as_blank(&self) -> Option<&<Id<I, B> as MaybeBlankId>::BlankId>

Returns a reference to the blank node identifier value, if any.
Source§

fn is_blank(&self) -> bool

Source§

impl<I, B> TryAsIri for Id<I, B>

Source§

fn try_as_iri(&self) -> Option<&I>

Returns a reference to the iri value, if any.
Source§

fn is_iri(&self) -> bool

Source§

impl<'a, T, B> TryFrom<&'a Id<T, B>> for &'a Id<T, B>

Source§

type Error = &'a String

The type returned in the event of a conversion error.
Source§

fn try_from( r: &'a Id<T, B>, ) -> Result<&'a Id<T, B>, <&'a Id<T, B> as TryFrom<&'a Id<T, B>>>::Error>

Performs the conversion.
Source§

impl<'a, T, B> TryFrom<&'a mut Id<T, B>> for &'a mut Id<T, B>

Source§

type Error = &'a mut String

The type returned in the event of a conversion error.
Source§

fn try_from( r: &'a mut Id<T, B>, ) -> Result<&'a mut Id<T, B>, <&'a mut Id<T, B> as TryFrom<&'a mut Id<T, B>>>::Error>

Performs the conversion.
Source§

impl<T, B> TryFrom<Id<T, B>> for Id<T, B>

Source§

type Error = String

The type returned in the event of a conversion error.
Source§

fn try_from( r: Id<T, B>, ) -> Result<Id<T, B>, <Id<T, B> as TryFrom<Id<T, B>>>::Error>

Performs the conversion.
Source§

impl<I, B> TryIntoBlankId for Id<I, B>

Source§

fn try_into_blank(self) -> Result<<Id<I, B> as MaybeBlankId>::BlankId, Id<I, B>>

Source§

impl<I, B> TryIntoId for Id<I, B>

Source§

fn try_into_id(self) -> Result<Id<I, B>, Id<I, B>>

Source§

impl<I, B> TryIntoIri for Id<I, B>

Source§

fn try_into_iri(self) -> Result<I, Id<I, B>>

Source§

impl<I, B> Copy for Id<I, B>
where I: Copy, B: Copy,

Source§

impl<I, B> Eq for Id<I, B>
where I: Eq, B: Eq,

Auto Trait Implementations§

§

impl<I, B> Freeze for Id<I, B>
where B: Freeze, I: Freeze,

§

impl<I, B> RefUnwindSafe for Id<I, B>

§

impl<I, B> Send for Id<I, B>
where B: Send, I: Send,

§

impl<I, B> Sync for Id<I, B>
where B: Sync, I: Sync,

§

impl<I, B> Unpin for Id<I, B>
where B: Unpin, I: Unpin,

§

impl<I, B> UnwindSafe for Id<I, B>
where B: UnwindSafe, I: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> At for T

Source§

fn at<M>(self, metadata: M) -> Meta<T, M>

Wraps self inside a Meta<Self, M> using the given metadata. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> BorrowStripped for T

Source§

fn stripped(&self) -> &Stripped<T>

Source§

impl<T> BorrowUnordered for T

Source§

impl<T> CallHasher for T
where T: Hash + ?Sized,

Source§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64
where H: Hash + ?Sized, B: BuildHasher,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

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
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, C> FromWithContext<T, C> for T

Source§

fn from_with(value: T, _context: &C) -> T

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U, C> IntoWithContext<U, C> for T
where U: FromWithContext<T, C>,

Source§

fn into_with(self, context: &C) -> U

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToOwned for T

Source§

type Owned = T

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> ToStringFallible for T
where T: Display,

Source§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

Source§

impl<T> TryAsId for T

Source§

fn try_as_id(&self) -> Option<Id<&Self::Iri, &Self::BlankId>>

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U, C> TryFromWithContext<U, C> for T
where U: IntoWithContext<T, C>,

Source§

type Error = Infallible

Source§

fn try_from_with( value: U, context: &C, ) -> Result<T, <T as TryFromWithContext<U, C>>::Error>

Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, U, C> TryIntoWithContext<U, C> for T
where U: TryFromWithContext<T, C>,

Source§

type Error = <U as TryFromWithContext<T, C>>::Error

Source§

fn try_into_with( self, context: &C, ) -> Result<U, <T as TryIntoWithContext<U, C>>::Error>

Source§

impl<T> WithContext for T
where T: ?Sized,

Source§

fn with<C>(&self, context: C) -> Contextual<&T, C>

Source§

fn into_with<C>(self, context: C) -> Contextual<T, C>

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeId for T