pub struct NodeMapGraph<T, B> { /* private fields */ }
Implementations§
Source§impl<T, B> NodeMapGraph<T, B>
impl<T, B> NodeMapGraph<T, B>
pub fn new() -> NodeMapGraph<T, B>
Source§impl<T, B> NodeMapGraph<T, B>
impl<T, B> NodeMapGraph<T, B>
pub fn contains(&self, id: &Id<T, B>) -> bool
pub fn get(&self, id: &Id<T, B>) -> Option<&Indexed<Node<T, B>>>
pub fn get_mut(&mut self, id: &Id<T, B>) -> Option<&mut Indexed<Node<T, B>>>
pub fn declare_node( &mut self, id: Id<T, B>, index: Option<&str>, ) -> Result<&mut Indexed<Node<T, B>>, ConflictingIndexes<T, B>>
Sourcepub fn merge_with(&mut self, other: NodeMapGraph<T, B>)
pub fn merge_with(&mut self, other: NodeMapGraph<T, B>)
Merge this graph with other
.
This calls merge_node
with every node of other
.
Sourcepub fn merge_node(&mut self, node: Indexed<Node<T, B>>)
pub fn merge_node(&mut self, node: Indexed<Node<T, B>>)
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>, Indexed<Node<T, B>>> ⓘ
pub fn into_nodes(self) -> IntoValues<Id<T, B>, Indexed<Node<T, B>>> ⓘ
Trait Implementations§
Source§impl<T, B> Default for NodeMapGraph<T, B>
impl<T, B> Default for NodeMapGraph<T, B>
Source§fn default() -> NodeMapGraph<T, B>
fn default() -> NodeMapGraph<T, B>
Returns the “default value” for a type. Read more
Source§impl<'a, T, B> IntoIterator for &'a NodeMapGraph<T, B>
impl<'a, T, B> IntoIterator for &'a NodeMapGraph<T, B>
Source§type Item = (&'a Id<T, B>, &'a Indexed<Node<T, B>>)
type Item = (&'a Id<T, B>, &'a Indexed<Node<T, B>>)
The type of the elements being iterated over.
Source§type IntoIter = Iter<'a, Id<T, B>, Indexed<Node<T, B>>>
type IntoIter = Iter<'a, Id<T, B>, Indexed<Node<T, B>>>
Which kind of iterator are we turning this into?
Source§fn into_iter(self) -> <&'a NodeMapGraph<T, B> as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a NodeMapGraph<T, B> as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
Source§impl<T, B> IntoIterator for NodeMapGraph<T, B>
impl<T, B> IntoIterator for NodeMapGraph<T, B>
Auto Trait Implementations§
impl<T, B> Freeze for NodeMapGraph<T, B>
impl<T, B> RefUnwindSafe for NodeMapGraph<T, B>where
B: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, B> Send for NodeMapGraph<T, B>
impl<T, B> Sync for NodeMapGraph<T, B>
impl<T, B> Unpin for NodeMapGraph<T, B>
impl<T, B> UnwindSafe for NodeMapGraph<T, B>where
B: UnwindSafe,
T: 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