Struct json_ld::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>
pub fn new() -> NodeMapGraph<T, B, M>
source§impl<T, B, M> NodeMapGraph<T, B, M>where
T: Eq + Hash,
B: Eq + Hash,
impl<T, B, M> NodeMapGraph<T, B, M>where
T: Eq + Hash,
B: Eq + Hash,
pub fn contains(&self, id: &Id<T, B>) -> bool
pub fn get(&self, id: &Id<T, B>) -> Option<&Meta<Indexed<Node<T, B, M>, M>, M>>
pub fn get_mut(
&mut self,
id: &Id<T, B>
) -> Option<&mut Meta<Indexed<Node<T, B, M>, M>, M>>
pub fn declare_node(
&mut self,
id: Meta<Id<T, B>, M>,
index: Option<&Entry<String, M>>
) -> Result<&mut Indexed<Node<T, B, M>, M>, ConflictingIndexes<T, B, M>>where
T: Clone,
B: Clone,
M: Clone,
sourcepub fn merge_with(&mut self, other: NodeMapGraph<T, B, M>)where
T: Clone,
B: Clone,
M: Clone,
pub fn merge_with(&mut self, other: NodeMapGraph<T, B, M>)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<Indexed<Node<T, B, M>, M>, M>)where
T: Clone,
B: Clone,
M: Clone,
pub fn merge_node(&mut self, _: Meta<Indexed<Node<T, B, M>, M>, 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.
pub fn nodes(&self) -> Values<'_, Id<T, B>, Meta<Indexed<Node<T, B, M>, M>, M>>
pub fn into_nodes(
self
) -> IntoValues<Id<T, B>, Meta<Indexed<Node<T, B, M>, M>, M>>
Trait Implementations§
source§impl<T, B, M> Default for NodeMapGraph<T, B, M>
impl<T, B, M> Default for NodeMapGraph<T, B, M>
source§fn default() -> NodeMapGraph<T, B, M>
fn default() -> NodeMapGraph<T, B, M>
Returns the “default value” for a type. Read more
source§impl<'a, T, B, M> IntoIterator for &'a NodeMapGraph<T, B, M>
impl<'a, T, B, M> IntoIterator for &'a NodeMapGraph<T, B, M>
§type Item = (&'a Id<T, B>, &'a Meta<Indexed<Node<T, B, M>, M>, M>)
type Item = (&'a Id<T, B>, &'a Meta<Indexed<Node<T, B, M>, M>, M>)
The type of the elements being iterated over.
§type IntoIter = Iter<'a, Id<T, B>, Meta<Indexed<Node<T, B, M>, M>, M>>
type IntoIter = Iter<'a, Id<T, B>, Meta<Indexed<Node<T, B, M>, M>, M>>
Which kind of iterator are we turning this into?
source§fn into_iter(self) -> <&'a NodeMapGraph<T, B, M> as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a NodeMapGraph<T, B, M> as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
source§impl<T, B, M> IntoIterator for NodeMapGraph<T, B, M>
impl<T, B, M> IntoIterator for NodeMapGraph<T, B, M>
§type Item = (Id<T, B>, Meta<Indexed<Node<T, B, M>, M>, M>)
type Item = (Id<T, B>, Meta<Indexed<Node<T, B, M>, M>, M>)
The type of the elements being iterated over.
§type IntoIter = IntoIter<Id<T, B>, Meta<Indexed<Node<T, B, M>, M>, M>>
type IntoIter = IntoIter<Id<T, B>, Meta<Indexed<Node<T, B, M>, M>, M>>
Which kind of iterator are we turning this into?
source§fn into_iter(self) -> <NodeMapGraph<T, B, M> as IntoIterator>::IntoIter
fn into_iter(self) -> <NodeMapGraph<T, B, M> as IntoIterator>::IntoIter
Creates an iterator from a value. Read more