pub enum TermDefinition {
Simple(Simple),
Expanded(Box<Expanded>),
}Expand description
Definition bound to a term by a context.
Variants§
Simple(Simple)
A string mapping the term directly to an IRI, a compact IRI or a blank node identifier.
Expanded(Box<Expanded>)
An object, which can set more about the term than the IRI it maps to.
Implementations§
Source§impl TermDefinition
impl TermDefinition
Sourcepub fn is_expanded(&self) -> bool
pub fn is_expanded(&self) -> bool
Checks whether this definition is in expanded form.
Sourcepub fn is_object(&self) -> bool
pub fn is_object(&self) -> bool
Checks whether this definition is written as a JSON object, which is the case exactly when it is in expanded form.
Sourcepub fn as_expanded(&self) -> ExpandedRef<'_>
pub fn as_expanded(&self) -> ExpandedRef<'_>
Returns a borrowed view of this definition in expanded form.
A simple definition is presented as an expanded one whose only entry is
the @id it maps to.
Trait Implementations§
Source§impl Clone for TermDefinition
impl Clone for TermDefinition
Source§impl Debug for TermDefinition
impl Debug for TermDefinition
Source§impl<'de> Deserialize<'de> for TermDefinition
Available on crate feature serde only.
impl<'de> Deserialize<'de> for TermDefinition
Available on crate feature
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TermDefinition
Source§impl IntoJson for TermDefinition
impl IntoJson for TermDefinition
Source§impl PartialEq for TermDefinition
impl PartialEq for TermDefinition
Source§impl PrecomputeSize for TermDefinition
impl PrecomputeSize for TermDefinition
Source§impl PrintWithSize for TermDefinition
impl PrintWithSize for TermDefinition
Source§impl Serialize for TermDefinition
Available on crate feature serde only.
impl Serialize for TermDefinition
Available on crate feature
serde only.impl StructuralPartialEq for TermDefinition
Source§impl TryFromJson for TermDefinition
impl TryFromJson for TermDefinition
Source§type Error = InvalidContext
type Error = InvalidContext
Error raised when the JSON value does not describe a valid
Self.Source§fn try_from_json(value: &Value) -> Result<Self, InvalidContext>
fn try_from_json(value: &Value) -> Result<Self, InvalidContext>
Builds a value of this type from the given JSON value. Read more
Auto Trait Implementations§
impl Freeze for TermDefinition
impl RefUnwindSafe for TermDefinition
impl Send for TermDefinition
impl Sync for TermDefinition
impl Unpin for TermDefinition
impl UnsafeUnpin for TermDefinition
impl UnwindSafe for TermDefinition
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
Mutably borrows from an owned value. Read more
Source§impl<T> BorrowUnordered for T
impl<T> BorrowUnordered for T
Source§fn as_unordered(&self) -> &Unordered<T>
fn as_unordered(&self) -> &Unordered<T>
Views this value as an
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,
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
Checks if
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
Compare self to
key and return true if they are equal.