Struct json_ld_core::context::Definitions
source · pub struct Definitions<T, B> { /* private fields */ }
Expand description
Context term definitions.
Implementations§
source§impl<T, B> Definitions<T, B>
impl<T, B> Definitions<T, B>
pub fn into_parts( self, ) -> (HashMap<Key, NormalTermDefinition<T, B>>, Option<TypeTermDefinition>)
sourcepub fn get<Q>(&self, term: &Q) -> Option<TermDefinitionRef<'_, T, B>>
pub fn get<Q>(&self, term: &Q) -> Option<TermDefinitionRef<'_, T, B>>
Returns a reference to the definition of the given term
, if any.
sourcepub fn get_normal<Q>(&self, term: &Q) -> Option<&NormalTermDefinition<T, B>>
pub fn get_normal<Q>(&self, term: &Q) -> Option<&NormalTermDefinition<T, B>>
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) -> bool
sourcepub fn insert(&mut self, binding: Binding<T, B>) -> Option<TermDefinition<T, B>>
pub fn insert(&mut self, binding: Binding<T, B>) -> Option<TermDefinition<T, B>>
Inserts the given binding
.
sourcepub fn insert_normal(
&mut self,
term: Key,
definition: NormalTermDefinition<T, B>,
) -> Option<NormalTermDefinition<T, B>>
pub fn insert_normal( &mut self, term: Key, definition: NormalTermDefinition<T, B>, ) -> Option<NormalTermDefinition<T, B>>
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>>,
) -> Option<NormalTermDefinition<T, B>>
pub fn set_normal( &mut self, term: Key, definition: Option<NormalTermDefinition<T, B>>, ) -> Option<NormalTermDefinition<T, B>>
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.
pub fn map_ids<U, C>( self, map_iri: impl FnMut(T) -> U, map_id: impl FnMut(Id<T, B>) -> Id<U, C>, ) -> Definitions<U, C>
Trait Implementations§
source§impl<T: Clone, B: Clone> Clone for Definitions<T, B>
impl<T: Clone, B: Clone> Clone for Definitions<T, B>
source§fn clone(&self) -> Definitions<T, B>
fn clone(&self) -> Definitions<T, B>
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> Default for Definitions<T, B>
impl<T, B> Default for Definitions<T, B>
source§impl<'a, T, B> IntoIterator for &'a Definitions<T, B>
impl<'a, T, B> IntoIterator for &'a Definitions<T, B>
Auto Trait Implementations§
impl<T, B> Freeze for Definitions<T, B>
impl<T, B> RefUnwindSafe for Definitions<T, B>where
T: RefUnwindSafe,
B: RefUnwindSafe,
impl<T, B> Send for Definitions<T, B>
impl<T, B> Sync for Definitions<T, B>
impl<T, B> Unpin for Definitions<T, B>
impl<T, B> UnwindSafe for Definitions<T, B>where
T: UnwindSafe,
B: UnwindSafe,
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)