pub enum Id {
Keyword(Keyword),
Term(String),
}Expand description
Value of the @id entry of a term definition.
Variants§
Keyword(Keyword)
A JSON-LD keyword, which makes the term an alias of that keyword.
Term(String)
Anything else: an IRI, a compact IRI, a blank node identifier or another term of the context. Kept unvalidated, as telling those apart requires the processed context.
Implementations§
Source§impl Id
impl Id
Sourcepub fn as_iri(&self) -> Option<Iri<&str>>
pub fn as_iri(&self) -> Option<Iri<&str>>
Parses this value as an IRI, returning None if it is not one.
Sourcepub fn as_blank_id(&self) -> Option<&BlankId>
pub fn as_blank_id(&self) -> Option<&BlankId>
Parses this value as a blank node identifier, returning None if it is
not one.
Sourcepub fn as_compact_iri(&self) -> Option<&CompactIri>
pub fn as_compact_iri(&self) -> Option<&CompactIri>
Parses this value as a compact IRI, returning None if it is not one.
Sourcepub fn as_keyword(&self) -> Option<Keyword>
pub fn as_keyword(&self) -> Option<Keyword>
Returns the keyword, or None if this value is not one.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Converts this value into an owned String, allocating if it is a
keyword.
Sourcepub fn is_keyword(&self) -> bool
pub fn is_keyword(&self) -> bool
Checks whether this value is a JSON-LD keyword.
Sourcepub fn is_keyword_like(&self) -> bool
pub fn is_keyword_like(&self) -> bool
Checks whether this value is keyword-like: an @ followed by ASCII
letters. See crate::is_keyword_like.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Id
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Id
serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Id
Source§impl<'a> From<&'a Id> for ExpandableRef<'a>
impl<'a> From<&'a Id> for ExpandableRef<'a>
Source§impl Ord for Id
impl Ord for Id
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Id
impl PartialOrd for Id
Source§impl PrecomputeSize for Id
impl PrecomputeSize for Id
Source§impl Print for Id
impl Print for Id
Source§fn fmt_with(
&self,
f: &mut Formatter<'_>,
_options: &Options,
_indent: usize,
) -> Result
fn fmt_with( &self, f: &mut Formatter<'_>, _options: &Options, _indent: usize, ) -> Result
f with the given options, starting at the given
indentation level. Read moreSource§fn pretty_print(&self) -> Printed<'_, Self>
fn pretty_print(&self) -> Printed<'_, Self>
Options::pretty options.Source§fn compact_print(&self) -> Printed<'_, Self>
fn compact_print(&self) -> Printed<'_, Self>
Options::compact options.Source§fn inline_print(&self) -> Printed<'_, Self>
fn inline_print(&self) -> Printed<'_, Self>
Options::inline options.Source§fn print_with(&self, options: Options) -> Printed<'_, Self>
fn print_with(&self, options: Options) -> Printed<'_, Self>
Source§impl TryFromJson for Id
impl TryFromJson for Id
Source§type Error = InvalidContext
type Error = InvalidContext
Self.Source§fn try_from_json(value: &Value) -> Result<Self, InvalidContext>
fn try_from_json(value: &Value) -> Result<Self, InvalidContext>
Auto Trait Implementations§
impl Freeze for Id
impl RefUnwindSafe for Id
impl Send for Id
impl Sync for Id
impl Unpin for Id
impl UnsafeUnpin for Id
impl UnwindSafe for Id
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
Source§impl<T> BorrowUnordered for T
impl<T> BorrowUnordered for T
Source§fn as_unordered(&self) -> &Unordered<T>
fn as_unordered(&self) -> &Unordered<T>
Unordered reference.impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
self is equivalent to key.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
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more