Struct json_ld_core::context::Definitions
source · pub struct Definitions<T, B, L, M> { /* private fields */ }
Expand description
Context term definitions.
Implementations§
source§impl<T, B, L, M> Definitions<T, B, L, M>
impl<T, B, L, M> Definitions<T, B, L, M>
pub fn into_parts(
self
) -> (HashMap<Key, NormalTermDefinition<T, B, L, M>>, Option<TypeTermDefinition>)
sourcepub fn get<Q>(&self, term: &Q) -> Option<TermDefinitionRef<'_, T, B, L, M>>where
Q: Hash + Eq + ?Sized,
Key: Borrow<Q>,
KeywordType: Borrow<Q>,
pub fn get<Q>(&self, term: &Q) -> Option<TermDefinitionRef<'_, T, B, L, M>>where
Q: Hash + Eq + ?Sized,
Key: Borrow<Q>,
KeywordType: Borrow<Q>,
Returns a reference to the definition of the given term
, if any.
sourcepub fn get_normal<Q>(
&self,
term: &Q
) -> Option<&NormalTermDefinition<T, B, L, M>>where
Q: Hash + Eq + ?Sized,
Key: Borrow<Q>,
pub fn get_normal<Q>(
&self,
term: &Q
) -> Option<&NormalTermDefinition<T, B, L, M>>where
Q: Hash + Eq + ?Sized,
Key: Borrow<Q>,
Returns a reference to the normal definition of the given term
, if any.
sourcepub fn get_type(&self) -> Option<&TypeTermDefinition>
pub fn get_type(&self) -> Option<&TypeTermDefinition>
Returns a reference to the @type
definition, if any.
pub fn contains_term<Q>(&self, term: &Q) -> boolwhere
Q: Hash + Eq + ?Sized,
Key: Borrow<Q>,
KeywordType: Borrow<Q>,
sourcepub fn insert(
&mut self,
binding: Binding<T, B, L, M>
) -> Option<TermDefinition<T, B, L, M>>
pub fn insert(
&mut self,
binding: Binding<T, B, L, M>
) -> Option<TermDefinition<T, B, L, M>>
Inserts the given binding
.
sourcepub fn insert_normal(
&mut self,
term: Key,
definition: NormalTermDefinition<T, B, L, M>
) -> Option<NormalTermDefinition<T, B, L, M>>
pub fn insert_normal(
&mut self,
term: Key,
definition: NormalTermDefinition<T, B, L, M>
) -> Option<NormalTermDefinition<T, B, L, M>>
Defines the given normal term.
sourcepub fn insert_type(
&mut self,
definition: TypeTermDefinition
) -> Option<TypeTermDefinition>
pub fn insert_type(
&mut self,
definition: TypeTermDefinition
) -> Option<TypeTermDefinition>
Inserts the given @type
definition.
sourcepub fn set_normal(
&mut self,
term: Key,
definition: Option<NormalTermDefinition<T, B, L, M>>
) -> Option<NormalTermDefinition<T, B, L, M>>
pub fn set_normal(
&mut self,
term: Key,
definition: Option<NormalTermDefinition<T, B, L, M>>
) -> Option<NormalTermDefinition<T, B, L, M>>
Sets the given term
normal definition.
sourcepub fn set_type(
&mut self,
definition: Option<TypeTermDefinition>
) -> Option<TypeTermDefinition>
pub fn set_type(
&mut self,
definition: Option<TypeTermDefinition>
) -> Option<TypeTermDefinition>
Sets the given @type
definition.
Trait Implementations§
source§impl<T: Clone, B: Clone, L: Clone, M: Clone> Clone for Definitions<T, B, L, M>
impl<T: Clone, B: Clone, L: Clone, M: Clone> Clone for Definitions<T, B, L, M>
source§fn clone(&self) -> Definitions<T, B, L, M>
fn clone(&self) -> Definitions<T, B, L, M>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more