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§
impl Eq for Context
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 IntoIterator for Context
impl IntoIterator for Context
Source§impl<'a> IntoIterator for &'a Context
impl<'a> IntoIterator for &'a 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
impl StructuralPartialEq for Context
Source§impl TryFromJson for Context
impl TryFromJson for Context
type Error = InvalidContext
fn try_from_json(value: Value) -> Result<Self, InvalidContext>
Auto Trait Implementations§
impl Forget for Context
impl Freeze for Contextwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<usize>: Freeze,
PhantomData<Bucket<Key, Nullable<TermDefinition>>>: Freeze,
PhantomData<ContextEntry>: Freeze,
impl Move for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnsafeUnpin for Contextwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
PhantomData<Bucket<Key, Nullable<TermDefinition>>>: UnsafeUnpin,
PhantomData<ContextEntry>: UnsafeUnpin,
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.