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§

§

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) -> &strwhere 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<IriBuf, BlankIdBuf>

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,

Trait Implementations§

source§

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

source§

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

source§

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

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

fn is_iri(&self) -> bool

source§

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

source§

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

source§

impl<I, B, V> AsRefWithContext<str, V> for Id<I, B>where V: Vocabulary<Iri = I, BlankId = B>,

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 copy 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<I, B, V> DisplayWithContext<V> for Id<I, B>where V: Vocabulary<Iri = I, BlankId = B>,

source§

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

source§

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

source§

fn equivalent(&self, key: &Id<I, B>) -> bool

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

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

source§

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

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

source§

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

source§

fn into_blank(self) -> Option<Self::BlankId>

Converts the value into a blank node identifier, if any.
source§

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

source§

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

source§

fn into_iri(self) -> Option<Self::Iri>

Converts the value into an iri, if any.
source§

impl<T: PartialEq, B: PartialEq> MappedEq<Id<T, B>> for ValidId<T, B>

§

type BlankId = B

source§

fn mapped_eq<'a, 'b, F: Clone + Fn(&'a Self::BlankId) -> &'b Self::BlankId>( &'a self, other: &Self, f: F ) -> boolwhere Self::BlankId: 'a + 'b,

Structural equality with mapped blank identifiers. Read more
source§

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

§

type BlankId = B

Inner blank node identifier type.
source§

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

§

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) -> Selfwhere Self: Sized,

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

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

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

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method 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

This method 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

This method 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

This method 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§

impl<I, B, V> RdfDisplayWithContext<V> for Id<I, B>where V: Vocabulary<Iri = I, BlankId = B>,

source§

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

source§

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

§

type Stripped = Id<I, B>

source§

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

source§

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

source§

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

source§

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

source§

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

source§

impl<I, B, __I, __B> StrippedPartialEq<Id<__I, __B>> for Id<I, B>where I: PartialEq<__I>, B: PartialEq<__B>,

source§

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

source§

fn stripped_partial_cmp(&self, other: &Id<__I, __B>) -> Option<Ordering>

source§

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

§

type Error = &'a String

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

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

Performs the conversion.
source§

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

§

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<Self, Self::Error>

Performs the conversion.
source§

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

§

type Error = String

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

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

Performs the conversion.
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,

source§

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

source§

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>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 Twhere 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 Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · 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§

fn unordered(&self) -> &Unordered<T>

§

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

§

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

source§

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

source§

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

source§

impl<Q, K> Equivalent<K> for Qwhere 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 Qwhere 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<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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> ToOwned for Twhere T: Clone,

§

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

§

type Owned = T

source§

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

source§

default fn to_string(&self) -> String

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

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

source§

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

source§

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