pub struct AnchorMut<'this, 'id, T>where
T: GraphImpl + 'this,{ /* private fields */ }
Implementations§
Source§impl<'this, 'id, N: 'this, E: 'this, Root> AnchorMut<'this, 'id, GenericGraph<Root, NamedNode<N, E>>>where
Root: RootCollection<'static, NamedNode<N, E>> + 'this,
impl<'this, 'id, N: 'this, E: 'this, Root> AnchorMut<'this, 'id, GenericGraph<Root, NamedNode<N, E>>>where
Root: RootCollection<'static, NamedNode<N, E>> + 'this,
Source§impl<'this, 'id, N: 'this, E: 'this, Root> AnchorMut<'this, 'id, GenericGraph<Root, NamedNode<N, E>>>where
Root: RootCollection<'static, NamedNode<N, E>> + 'this,
impl<'this, 'id, N: 'this, E: 'this, Root> AnchorMut<'this, 'id, GenericGraph<Root, NamedNode<N, E>>>where
Root: RootCollection<'static, NamedNode<N, E>> + 'this,
Source§impl<'this, 'id, N: 'this, E: 'this, Root> AnchorMut<'this, 'id, GenericGraph<Root, OptionNode<N, E>>>where
Root: RootCollection<'static, OptionNode<N, E>> + 'this,
impl<'this, 'id, N: 'this, E: 'this, Root> AnchorMut<'this, 'id, GenericGraph<Root, OptionNode<N, E>>>where
Root: RootCollection<'static, OptionNode<N, E>> + 'this,
Sourcepub fn edges(
&self,
src: GraphPtr<'id, OptionNode<N, E>>,
) -> impl Iterator<Item = GraphItem<Edge<&N, &E>, GraphPtr<'id, OptionNode<N, E>>>>
pub fn edges( &self, src: GraphPtr<'id, OptionNode<N, E>>, ) -> impl Iterator<Item = GraphItem<Edge<&N, &E>, GraphPtr<'id, OptionNode<N, E>>>>
Returns an iterator over edges attached to src
node.
Source§impl<'this, 'id, N: 'this, E: 'this, Root> AnchorMut<'this, 'id, GenericGraph<Root, OptionNode<N, E>>>where
Root: RootCollection<'static, OptionNode<N, E>> + 'this,
impl<'this, 'id, N: 'this, E: 'this, Root> AnchorMut<'this, 'id, GenericGraph<Root, OptionNode<N, E>>>where
Root: RootCollection<'static, OptionNode<N, E>> + 'this,
Sourcepub fn edges_mut(
&mut self,
src: GraphPtr<'id, OptionNode<N, E>>,
) -> impl Iterator<Item = GraphItem<Edge<&mut N, &mut E>, GraphPtr<'id, OptionNode<N, E>>>>
pub fn edges_mut( &mut self, src: GraphPtr<'id, OptionNode<N, E>>, ) -> impl Iterator<Item = GraphItem<Edge<&mut N, &mut E>, GraphPtr<'id, OptionNode<N, E>>>>
Returns a mutable iterator over edges attached to src
node.
Sourcepub fn bridge(
&mut self,
src: GraphPtr<'id, OptionNode<N, E>>,
dst: GraphPtr<'id, OptionNode<N, E>>,
) -> Option<(&mut OptionNode<'id, N, E>, &mut OptionNode<'id, N, E>)>
pub fn bridge( &mut self, src: GraphPtr<'id, OptionNode<N, E>>, dst: GraphPtr<'id, OptionNode<N, E>>, ) -> Option<(&mut OptionNode<'id, N, E>, &mut OptionNode<'id, N, E>)>
Provides direct mutable direct access to two different nodes src
and dst
. Returns or None if src
is the same as dst
.
Source§impl<'this, 'id, N: 'this, E: 'this, Root> AnchorMut<'this, 'id, GenericGraph<Root, VecNode<N, E>>>where
Root: RootCollection<'static, VecNode<N, E>> + 'this,
impl<'this, 'id, N: 'this, E: 'this, Root> AnchorMut<'this, 'id, GenericGraph<Root, VecNode<N, E>>>where
Root: RootCollection<'static, VecNode<N, E>> + 'this,
Source§impl<'this, 'id, N: 'this, E: 'this, Root> AnchorMut<'this, 'id, GenericGraph<Root, VecNode<N, E>>>where
Root: RootCollection<'static, VecNode<N, E>> + 'this,
impl<'this, 'id, N: 'this, E: 'this, Root> AnchorMut<'this, 'id, GenericGraph<Root, VecNode<N, E>>>where
Root: RootCollection<'static, VecNode<N, E>> + 'this,
Source§impl<'this, 'id, K, N: 'this, E: 'this, Root> AnchorMut<'this, 'id, GenericGraph<Root, TreeNode<K, N, E>>>
impl<'this, 'id, K, N: 'this, E: 'this, Root> AnchorMut<'this, 'id, GenericGraph<Root, TreeNode<K, N, E>>>
Source§impl<'this, 'id, K, N: 'this, E: 'this, Root> AnchorMut<'this, 'id, GenericGraph<Root, TreeNode<K, N, E>>>
impl<'this, 'id, K, N: 'this, E: 'this, Root> AnchorMut<'this, 'id, GenericGraph<Root, TreeNode<K, N, E>>>
Source§impl<'this, 'id, N: 'this, NodeType, Root> AnchorMut<'this, 'id, GenericGraph<Root, NodeType>>where
NodeType: GraphNode<Node = N> + 'this,
Root: RootCollection<'static, NodeType> + 'this,
impl<'this, 'id, N: 'this, NodeType, Root> AnchorMut<'this, 'id, GenericGraph<Root, NodeType>>where
NodeType: GraphNode<Node = N> + 'this,
Root: RootCollection<'static, NodeType> + 'this,
Sourcepub unsafe fn from_raw(&self, raw: *const NodeType) -> GraphPtr<'id, NodeType>
pub unsafe fn from_raw(&self, raw: *const NodeType) -> GraphPtr<'id, NodeType>
Creates a checked pointer from a raw pointer.
§Safety
Caller must guarantee raw
points to a node which was not cleaned up and belongs to the parent graph.
Source§impl<'this, 'id, N: 'this, NodeType, Root> AnchorMut<'this, 'id, GenericGraph<Root, NodeType>>where
NodeType: GraphNode<Node = N> + 'this,
Root: RootCollection<'static, NodeType> + 'this,
impl<'this, 'id, N: 'this, NodeType, Root> AnchorMut<'this, 'id, GenericGraph<Root, NodeType>>where
NodeType: GraphNode<Node = N> + 'this,
Root: RootCollection<'static, NodeType> + 'this,
Sourcepub fn spawn(&mut self, data: N) -> GraphPtr<'id, NodeType>
pub fn spawn(&mut self, data: N) -> GraphPtr<'id, NodeType>
Allocates a new node and returns the pointer. This node will become inaccessible when parent anchor is dropped and will be disposed of upon next cleanup unless you attach it to the root or another node accessible from the root.
Sourcepub unsafe fn kill(&mut self, dst: GraphPtr<'id, NodeType>)
pub unsafe fn kill(&mut self, dst: GraphPtr<'id, NodeType>)
Immediately drops dst
node and frees allocated memory.
§Safety
Caller must ensure killed node will never be accessed. dst
must become inaccesible from root before
anchor is dropped. Any copies of dst
in external collections should be disposed of as well.
Sourcepub fn cursor_mut(
&mut self,
dst: GraphPtr<'id, NodeType>,
) -> CursorMut<'_, 'id, NodeType>
pub fn cursor_mut( &mut self, dst: GraphPtr<'id, NodeType>, ) -> CursorMut<'_, 'id, NodeType>
Creates a mutable cursor pointing to dst
.
Source§impl<'this, 'id, N: 'this, NodeType> AnchorMut<'this, 'id, VecGraph<NodeType>>where
NodeType: GraphNode<Node = N> + 'this,
impl<'this, 'id, N: 'this, NodeType> AnchorMut<'this, 'id, VecGraph<NodeType>>where
NodeType: GraphNode<Node = N> + 'this,
Source§impl<'this, 'id, N: 'this, NodeType> AnchorMut<'this, 'id, NamedGraph<NodeType>>where
NodeType: GraphNode<Node = N> + 'this,
impl<'this, 'id, N: 'this, NodeType> AnchorMut<'this, 'id, NamedGraph<NodeType>>where
NodeType: GraphNode<Node = N> + 'this,
Source§impl<'this, 'id, N: 'this, NodeType> AnchorMut<'this, 'id, OptionGraph<NodeType>>where
NodeType: GraphNode<Node = N> + 'this,
impl<'this, 'id, N: 'this, NodeType> AnchorMut<'this, 'id, OptionGraph<NodeType>>where
NodeType: GraphNode<Node = N> + 'this,
Source§impl<'this, 'id, N: 'this, NodeType> AnchorMut<'this, 'id, VecGraph<NodeType>>where
NodeType: GraphNode<Node = N> + 'this,
impl<'this, 'id, N: 'this, NodeType> AnchorMut<'this, 'id, VecGraph<NodeType>>where
NodeType: GraphNode<Node = N> + 'this,
Source§impl<'this, 'id, N: 'this, NodeType> AnchorMut<'this, 'id, NamedGraph<NodeType>>where
NodeType: GraphNode<Node = N> + 'this,
impl<'this, 'id, N: 'this, NodeType> AnchorMut<'this, 'id, NamedGraph<NodeType>>where
NodeType: GraphNode<Node = N> + 'this,
Sourcepub fn root(&self) -> &RootNamedSet<'id, NodeType>
pub fn root(&self) -> &RootNamedSet<'id, NodeType>
Provides direct access to the collection of the root.
Sourcepub fn root_mut(&mut self) -> &mut RootNamedSet<'id, NodeType>
pub fn root_mut(&mut self) -> &mut RootNamedSet<'id, NodeType>
Provides direct mutable access to the collection of the root.
Source§impl<'this, 'id, N: 'this, NodeType> AnchorMut<'this, 'id, OptionGraph<NodeType>>where
NodeType: GraphNode<Node = N> + 'this,
impl<'this, 'id, N: 'this, NodeType> AnchorMut<'this, 'id, OptionGraph<NodeType>>where
NodeType: GraphNode<Node = N> + 'this,
Sourcepub fn root(&self) -> &RootOption<'id, NodeType>
pub fn root(&self) -> &RootOption<'id, NodeType>
Provides direct access to the collection of the root.
Sourcepub fn root_mut(&mut self) -> &mut RootOption<'id, NodeType>
pub fn root_mut(&mut self) -> &mut RootOption<'id, NodeType>
Provides direct mutable access to the collection of the root.