Skip to main content

ValidId

Enum ValidId 

Source
pub enum ValidId<I = IriBuf, B = BlankIdBuf> {
    Iri(I),
    Blank(B),
}
Expand description

Valid node identifier (IRI or blank node).

Variants§

§

Iri(I)

An IRI.

§

Blank(B)

A blank node identifier.

Implementations§

Source§

impl<I, B> ValidId<I, B>

Source

pub fn map<J, C>(self, f: impl FnOnce(Self) -> ValidId<J, C>) -> ValidId<J, C>

Rewrites this identifier with the given function.

Source

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

Borrows this ValidId.

Source

pub fn is_blank(&self) -> bool

Checks whether this identifier is a blank node identifier.

Source

pub fn is_iri(&self) -> bool

Checks whether this identifier is an IRI.

Source§

impl<I: AsRef<str>, B: AsRef<str>> ValidId<I, B>

Source

pub fn as_str(&self) -> &str

Returns this value as a string slice.

Trait Implementations§

Source§

impl<I: Clone, B: Clone> Clone for ValidId<I, B>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<I: Debug, B: Debug> Debug for ValidId<I, B>

Source§

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

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

impl<I: Display, B: Display> Display for ValidId<I, B>

Source§

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

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

impl<V: IriVocabulary + BlankIdVocabulary> DisplayWithContext<V> for ValidId<V::Iri, V::BlankId>

Source§

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

Source§

impl<I: Eq, B: Eq> Eq for ValidId<I, B>

Source§

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

Source§

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

Compare self to key and return true if they are equal.
Source§

impl<T, B> From<ValidId<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: Hash, B: Hash> Hash for ValidId<I, B>

Source§

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

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: Interpretation, T, B> LinkedDataResource<I> for ValidId<T, B>

Source§

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

Returns the interpretation of this resource, inserting it into interpretation if required.
Source§

fn lexical_representation<'a>( &'a self, interpretation: &'a mut I, ) -> Option<CowRdfTerm<'a>>

Returns the lexical term representing this resource, if any.
Source§

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

Returns the interpretation to use when this resource appears as a reference rather than as a subject with properties.
Source§

impl<I: Interpretation, T, B> LinkedDataSubject<I> for ValidId<T, B>

Source§

fn visit_subject<S>(&self, visitor: S) -> Result<S::Ok, S::Error>
where S: SubjectVisitor<I>,

Visits the properties of the subject represented by this value.
Source§

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

Source§

type BlankId = B

Blank node identifier type the renaming applies to.
Source§

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

Structural equality with mapped blank identifiers. Read more
Source§

impl<I: Ord, B: Ord> Ord for ValidId<I, B>

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

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

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

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

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

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

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

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

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

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<I: PartialOrd, B: PartialOrd> PartialOrd for ValidId<I, B>

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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: PartialEq, B: PartialEq> StructuralPartialEq for ValidId<I, B>

Source§

impl<'a, T, B> TryFrom<&'a Id<T, B>> for &'a ValidId<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<Self, Self::Error>

Performs the conversion.
Source§

impl<'a, T, B> TryFrom<&'a mut Id<T, B>> for &'a mut ValidId<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<Self, Self::Error>

Performs the conversion.
Source§

impl<T, B> TryFrom<Id<T, B>> for ValidId<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<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<I, B> UnsafeUnpin for ValidId<I, B>
where I: UnsafeUnpin, B: UnsafeUnpin,

§

impl<I, B> UnwindSafe for ValidId<I, B>
where I: UnwindSafe, B: 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> 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> BorrowUnordered for T

Source§

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

Views this value as an Unordered reference.
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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 self is equivalent to key.
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

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: Sized + 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: Sized + 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

type Error = !

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

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