Enum json_ld_syntax::context::Context
source · pub enum Context {
One(ContextEntry),
Many(Vec<ContextEntry>),
}
Expand description
JSON-LD Context.
Can represent a single context entry, or a list of context entries.
Variants§
One(ContextEntry)
Many(Vec<ContextEntry>)
Implementations§
source§impl Context
impl Context
sourcepub fn one(context: ContextEntry) -> Self
pub fn one(context: ContextEntry) -> Self
Creates a new context with a single entry.
sourcepub fn iri_ref(iri_ref: IriRefBuf) -> Self
pub fn iri_ref(iri_ref: IriRefBuf) -> Self
Creates a new context with a single IRI-reference entry.
sourcepub fn definition(def: Definition) -> Self
pub fn definition(def: Definition) -> Self
Creates a new context with a single context definition entry.
Trait Implementations§
source§impl From<ContextEntry> for Context
impl From<ContextEntry> for Context
source§fn from(c: ContextEntry) -> Self
fn from(c: ContextEntry) -> Self
Converts to this type from the input type.
source§impl From<Definition> for Context
impl From<Definition> for Context
source§fn from(c: Definition) -> Self
fn from(c: Definition) -> Self
Converts to this type from the input type.
source§impl<'a> IntoIterator for &'a Context
impl<'a> IntoIterator for &'a Context
source§impl IntoIterator for Context
impl IntoIterator for Context
source§impl PartialEq for Context
impl PartialEq for Context
source§impl PrecomputeSize for Context
impl PrecomputeSize for Context
source§impl Print for Context
impl Print for Context
fn fmt_with( &self, f: &mut Formatter<'_>, options: &Options, indent: usize ) -> Result
source§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 PrintWithSize for Context
impl PrintWithSize for Context
source§impl TryFromJson for Context
impl TryFromJson for Context
type Error = InvalidContext
fn try_from_json(value: Value) -> Result<Self, InvalidContext>
impl Eq for Context
impl StructuralPartialEq for Context
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
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
fn as_unordered(&self) -> &Unordered<T>
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
fn equivalent(&self, key: &K) -> bool
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.