Enum json_ld_core::id::Id
source · [−]pub enum Id<I = IriBuf, B = BlankIdBuf> {
Valid(ValidId<I, B>),
Invalid(String),
}
Expand description
Node identifier.
Used to reference a node across a document or to a remote document. It can be an identifier (IRI), a blank node identifier for local blank nodes or an invalid reference (a string that is neither an IRI nor blank node identifier).
Variants
Valid(ValidId<I, B>)
Invalid(String)
Invalid reference.
Implementations
sourceimpl<I: From<IriBuf>, B: From<BlankIdBuf>> Id<I, B>
impl<I: From<IriBuf>, B: From<BlankIdBuf>> Id<I, B>
pub fn from_string(s: String) -> Self
sourceimpl<I, B> Id<I, B>
impl<I, B> Id<I, B>
pub fn iri(iri: I) -> Self
pub fn blank(b: B) -> Self
pub fn from_string_in(
vocabulary: &mut impl VocabularyMut<Iri = I, BlankId = B>,
s: String
) -> Self
sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Checks if this is a valid reference.
Returns true
is this reference is a node identifier or a blank node identifier,
false
otherwise.
pub fn into_blank(self) -> Option<B>
sourcepub fn as_iri(&self) -> Option<&I>
pub fn as_iri(&self) -> Option<&I>
If the reference is a node identifier, returns the node IRI.
Returns None
if it is a blank node reference.
pub fn into_term(self) -> Term<I, B>
pub fn as_ref(&self) -> Ref<'_, I, B>
Trait Implementations
sourceimpl<T, B, N: Vocabulary<Iri = T, BlankId = B>> AsRefWithContext<str, N> for Id<T, B>
impl<T, B, N: Vocabulary<Iri = T, BlankId = B>> AsRefWithContext<str, N> for Id<T, B>
fn as_ref_with<'a>(&'a self, vocabulary: &'a N) -> &'a str
sourceimpl<T, B, N: Vocabulary<Iri = T, BlankId = B>> DisplayWithContext<N> for Id<T, B>
impl<T, B, N: Vocabulary<Iri = T, BlankId = B>> DisplayWithContext<N> for Id<T, B>
sourceimpl<T, B, M, N: Vocabulary<Iri = T, BlankId = B>> IntoJsonWithContextMeta<M, N> for Id<T, B>
impl<T, B, M, N: Vocabulary<Iri = T, BlankId = B>> IntoJsonWithContextMeta<M, N> for Id<T, B>
fn into_json_meta_with(self, meta: M, context: &N) -> Meta<Value<M>, M>
sourceimpl<I: Ord, B: Ord> Ord for Id<I, B>
impl<I: Ord, B: Ord> Ord for Id<I, B>
1.21.0 · sourceconst fn max(self, other: Self) -> Self
const fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourceconst fn min(self, other: Self) -> Self
const fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourceconst fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
const fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<I: PartialEq, B: PartialEq> PartialEq<Id<I, B>> for Id<I, B>
impl<I: PartialEq, B: PartialEq> PartialEq<Id<I, B>> for Id<I, B>
sourceimpl<T: PartialEq, B: PartialEq> PartialEq<Id<T, B>> for Term<T, B>
impl<T: PartialEq, B: PartialEq> PartialEq<Id<T, B>> for Term<T, B>
sourceimpl<T: PartialEq, B: PartialEq> PartialEq<Term<T, B>> for Id<T, B>
impl<T: PartialEq, B: PartialEq> PartialEq<Term<T, B>> for Id<T, B>
sourceimpl<T: PartialEq<str>, B: PartialEq<str>> PartialEq<str> for Id<T, B>
impl<T: PartialEq<str>, B: PartialEq<str>> PartialEq<str> for Id<T, B>
sourceimpl<I: PartialOrd, B: PartialOrd> PartialOrd<Id<I, B>> for Id<I, B>
impl<I: PartialOrd, B: PartialOrd> PartialOrd<Id<I, B>> for Id<I, B>
sourcefn partial_cmp(&self, other: &Id<I, B>) -> Option<Ordering>
fn partial_cmp(&self, other: &Id<I, B>) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const 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 moresourceimpl<T, B, N: Vocabulary<Iri = T, BlankId = B>> PrecomputeSizeWithContext<N> for Id<T, B>
impl<T, B, N: Vocabulary<Iri = T, BlankId = B>> PrecomputeSizeWithContext<N> for Id<T, B>
sourceimpl<T, B, N: Vocabulary<Iri = T, BlankId = B>> PrintWithContext<N> for Id<T, B>
impl<T, B, N: Vocabulary<Iri = T, BlankId = B>> PrintWithContext<N> for Id<T, B>
sourceimpl<T, B, N: Vocabulary<Iri = T, BlankId = B>> PrintWithSizeAndContext<N> for Id<T, B>
impl<T, B, N: Vocabulary<Iri = T, BlankId = B>> PrintWithSizeAndContext<N> for Id<T, B>
sourceimpl<I: Hash, B: Hash> StrippedHash for Id<I, B>
impl<I: Hash, B: Hash> StrippedHash for Id<I, B>
fn stripped_hash<H: Hasher>(&self, state: &mut H)
sourceimpl<I: PartialEq, B: PartialEq> StrippedPartialEq<Id<I, B>> for Id<I, B>
impl<I: PartialEq, B: PartialEq> StrippedPartialEq<Id<I, B>> for Id<I, B>
fn stripped_eq(&self, other: &Self) -> bool
sourceimpl<I, B, M> TryFromJson<I, B, M> for Id<I, B>
impl<I, B, M> TryFromJson<I, B, M> for Id<I, B>
fn try_from_json_in(
vocabulary: &mut impl VocabularyMut<Iri = I, BlankId = B>,
Meta: Meta<Value<M>, M>
) -> Result<Meta<Self, M>, Meta<InvalidExpandedJson<M>, M>>
impl<I: Eq, B: Eq> Eq for Id<I, B>
impl<I: Eq, B: Eq> StrippedEq for Id<I, B>
impl<I, B> StructuralEq for Id<I, B>
impl<I, B> StructuralPartialEq 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> BorrowStripped for T
impl<T> BorrowStripped for T
sourceimpl<T> BorrowUnordered for T
impl<T> BorrowUnordered for T
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
fn equivalent(&self, key: &K) -> bool
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.