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) -> Context
pub fn one(context: ContextEntry) -> Context
Creates a new context with a single entry.
Sourcepub fn iri_ref(iri_ref: IriRefBuf) -> Context
pub fn iri_ref(iri_ref: IriRefBuf) -> Context
Creates a new context with a single IRI-reference entry.
Sourcepub fn definition(def: Definition) -> Context
pub fn definition(def: Definition) -> Context
Creates a new context with a single context definition entry.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Context
impl<'de> Deserialize<'de> for Context
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Context, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Context, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<ContextEntry> for Context
impl From<ContextEntry> for Context
Source§fn from(c: ContextEntry) -> Context
fn from(c: ContextEntry) -> Context
Converts to this type from the input type.
Source§impl From<Definition> for Context
impl From<Definition> for Context
Source§fn from(c: Definition) -> Context
fn from(c: Definition) -> Context
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<T, B> IntoSyntax<T, B> for Context
impl<T, B> IntoSyntax<T, B> for Context
fn into_syntax( self, _namespace: &impl Vocabulary<Iri = T, BlankId = B>, ) -> 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<(), Error>
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 Process for Context
impl Process for Context
Source§async fn process_full<N, L, W>(
&self,
vocabulary: &mut N,
active_context: &Context<<N as IriVocabulary>::Iri, <N as BlankIdVocabulary>::BlankId>,
loader: &L,
base_url: Option<<N as IriVocabulary>::Iri>,
options: Options,
warnings: W,
) -> Result<Processed<'_, <N as IriVocabulary>::Iri, <N as BlankIdVocabulary>::BlankId>, Error>where
N: VocabularyMut,
<N as IriVocabulary>::Iri: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: Clone + PartialEq,
L: Loader,
W: WarningHandler<N>,
async fn process_full<N, L, W>(
&self,
vocabulary: &mut N,
active_context: &Context<<N as IriVocabulary>::Iri, <N as BlankIdVocabulary>::BlankId>,
loader: &L,
base_url: Option<<N as IriVocabulary>::Iri>,
options: Options,
warnings: W,
) -> Result<Processed<'_, <N as IriVocabulary>::Iri, <N as BlankIdVocabulary>::BlankId>, Error>where
N: VocabularyMut,
<N as IriVocabulary>::Iri: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: Clone + PartialEq,
L: Loader,
W: WarningHandler<N>,
Process the local context with specific options.
Source§async fn process_with<N, L>(
&self,
vocabulary: &mut N,
active_context: &Context<<N as IriVocabulary>::Iri, <N as BlankIdVocabulary>::BlankId>,
loader: &L,
base_url: Option<<N as IriVocabulary>::Iri>,
options: Options,
) -> Result<Processed<'_, <N as IriVocabulary>::Iri, <N as BlankIdVocabulary>::BlankId>, Error>where
N: VocabularyMut,
<N as IriVocabulary>::Iri: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: Clone + PartialEq,
L: Loader,
async fn process_with<N, L>(
&self,
vocabulary: &mut N,
active_context: &Context<<N as IriVocabulary>::Iri, <N as BlankIdVocabulary>::BlankId>,
loader: &L,
base_url: Option<<N as IriVocabulary>::Iri>,
options: Options,
) -> Result<Processed<'_, <N as IriVocabulary>::Iri, <N as BlankIdVocabulary>::BlankId>, Error>where
N: VocabularyMut,
<N as IriVocabulary>::Iri: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: Clone + PartialEq,
L: Loader,
Process the local context with specific options.
Source§async fn process<N, L>(
&self,
vocabulary: &mut N,
loader: &L,
base_url: Option<<N as IriVocabulary>::Iri>,
) -> Result<Processed<'_, <N as IriVocabulary>::Iri, <N as BlankIdVocabulary>::BlankId>, Error>where
N: VocabularyMut,
<N as IriVocabulary>::Iri: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: Clone + PartialEq,
L: Loader,
async fn process<N, L>(
&self,
vocabulary: &mut N,
loader: &L,
base_url: Option<<N as IriVocabulary>::Iri>,
) -> Result<Processed<'_, <N as IriVocabulary>::Iri, <N as BlankIdVocabulary>::BlankId>, Error>where
N: VocabularyMut,
<N as IriVocabulary>::Iri: Clone + Eq + Hash,
<N as BlankIdVocabulary>::BlankId: Clone + PartialEq,
L: Loader,
Process the local context with the given initial active context with the default options:
is_remote
is false
, override_protected
is false
and propagate
is true
.Source§impl Serialize for Context
impl Serialize for Context
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl TryFromJson for Context
impl TryFromJson for Context
type Error = InvalidContext
fn try_from_json(value: Value) -> Result<Context, 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<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
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.