Struct json_ld::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>, RandomState>, 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, B, L, M> Clone for Definitions<T, B, L, M>where
T: Clone,
B: Clone,
L: Clone,
M: Clone,
impl<T, B, L, M> Clone for Definitions<T, B, L, M>where
T: Clone,
B: Clone,
L: Clone,
M: Clone,
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 moresource§impl<T, B, L, M> Default for Definitions<T, B, L, M>
impl<T, B, L, M> Default for Definitions<T, B, L, M>
source§fn default() -> Definitions<T, B, L, M>
fn default() -> Definitions<T, B, L, M>
Returns the “default value” for a type. Read more
source§impl<'a, T, B, L, M> IntoIterator for &'a Definitions<T, B, L, M>
impl<'a, T, B, L, M> IntoIterator for &'a Definitions<T, B, L, M>
§type Item = BindingRef<'a, T, B, L, M>
type Item = BindingRef<'a, T, B, L, M>
The type of the elements being iterated over.
source§fn into_iter(self) -> <&'a Definitions<T, B, L, M> as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a Definitions<T, B, L, M> as IntoIterator>::IntoIter
Creates an iterator from a value. Read more