Struct json_ld_core::flattening::NodeMapGraph
source · pub struct NodeMapGraph<T, B, M> { /* private fields */ }
Implementations§
source§impl<T, B, M> NodeMapGraph<T, B, M>
impl<T, B, M> NodeMapGraph<T, B, M>
source§impl<T: Eq + Hash, B: Eq + Hash, M> NodeMapGraph<T, B, M>
impl<T: Eq + Hash, B: Eq + Hash, M> NodeMapGraph<T, B, M>
pub fn contains(&self, id: &Id<T, B>) -> bool
pub fn get(&self, id: &Id<T, B>) -> Option<&IndexedNode<T, B, M>>
pub fn get_mut(&mut self, id: &Id<T, B>) -> Option<&mut IndexedNode<T, B, M>>
pub fn declare_node( &mut self, id: Meta<Id<T, B>, M>, index: Option<&Entry<String, M>> ) -> DeclareNodeResult<'_, T, B, M>where T: Clone, B: Clone, M: Clone,
sourcepub fn merge_with(&mut self, other: Self)where
T: Clone,
B: Clone,
M: Clone,
pub fn merge_with(&mut self, other: Self)where T: Clone, B: Clone, M: Clone,
Merge this graph with other
.
This calls merge_node
with every node of other
.
sourcepub fn merge_node(&mut self, Meta: IndexedNode<T, B, M>)where
T: Clone,
B: Clone,
M: Clone,
pub fn merge_node(&mut self, Meta: IndexedNode<T, B, M>)where T: Clone, B: Clone, M: Clone,
Merge the given node
into the graph.
The node
must has an identifier, or this function will have no effect.
If there is already a node with the same identifier:
- The index of
node
, if any, overrides the previously existing index. - The list of
node
types is concatenated after the preexisting types. - The graph and imported values are overridden.
- Properties and reverse properties are merged.