pub enum Type {
Keyword(TypeKeyword),
Term(String),
}Expand description
Value of the @type entry of a term definition: the type mapping of the
term.
Variants§
Keyword(TypeKeyword)
One of the keywords @type accepts.
Term(String)
A datatype given as an IRI, a compact IRI or another term of the context. Kept unvalidated, as telling those apart requires the processed context.
Implementations§
Source§impl Type
impl Type
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_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<TypeKeyword>
pub fn as_keyword(&self) -> Option<TypeKeyword>
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.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Type
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Type
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 Type
Source§impl<'a> From<&'a Type> for ExpandableRef<'a>
impl<'a> From<&'a Type> for ExpandableRef<'a>
Source§impl Ord for Type
impl Ord for Type
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Type
impl PartialOrd for Type
Source§impl PrecomputeSize for Type
impl PrecomputeSize for Type
Source§impl Print for Type
impl Print for Type
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
Writes the value to
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>
Print the value with
Options::pretty options.Source§fn compact_print(&self) -> Printed<'_, Self>
fn compact_print(&self) -> Printed<'_, Self>
Print the value with
Options::compact options.Source§fn inline_print(&self) -> Printed<'_, Self>
fn inline_print(&self) -> Printed<'_, Self>
Print the value with
Options::inline options.Source§fn print_with(&self, options: Options) -> Printed<'_, Self>
fn print_with(&self, options: Options) -> Printed<'_, Self>
Print the value with the given options.
Source§impl TryFromJson for Type
impl TryFromJson for Type
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 Type
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnsafeUnpin for Type
impl UnwindSafe for Type
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,
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
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.