Struct AnchorMut

Source
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,

Source

pub fn edges( &self, src: GraphPtr<'id, NamedNode<N, E>>, ) -> impl Iterator<Item = GraphItem<Edge<&N, &E>, GraphPtr<'id, NamedNode<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, NamedNode<N, E>>>
where Root: RootCollection<'static, NamedNode<N, E>> + 'this,

Source

pub fn edges_mut( &mut self, src: GraphPtr<'id, NamedNode<N, E>>, ) -> impl Iterator<Item = GraphItem<Edge<&mut N, &mut E>, GraphPtr<'id, NamedNode<N, E>>>>

Returns a mutable iterator over edges attached to src node.

Source

pub fn bridge( &mut self, src: GraphPtr<'id, NamedNode<N, E>>, dst: GraphPtr<'id, NamedNode<N, E>>, ) -> Option<(&mut NamedNode<'id, N, E>, &mut NamedNode<'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, OptionNode<N, E>>>
where Root: RootCollection<'static, OptionNode<N, E>> + 'this,

Source

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,

Source

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.

Source

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,

Source

pub fn edges( &self, src: GraphPtr<'id, VecNode<N, E>>, ) -> impl Iterator<Item = GraphItem<Edge<&N, &E>, GraphPtr<'id, VecNode<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, VecNode<N, E>>>
where Root: RootCollection<'static, VecNode<N, E>> + 'this,

Source

pub fn edges_mut( &mut self, src: GraphPtr<'id, VecNode<N, E>>, ) -> impl Iterator<Item = GraphItem<Edge<&mut N, &mut E>, GraphPtr<'id, VecNode<N, E>>>>

Returns a mutable iterator over edges attached to src node.

Source

pub fn bridge( &mut self, src: GraphPtr<'id, VecNode<N, E>>, dst: GraphPtr<'id, VecNode<N, E>>, ) -> Option<(&mut VecNode<'id, N, E>, &mut VecNode<'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, K, N: 'this, E: 'this, Root> AnchorMut<'this, 'id, GenericGraph<Root, TreeNode<K, N, E>>>
where Root: RootCollection<'static, TreeNode<K, N, E>> + 'this, K: Ord + 'this,

Source

pub fn edges( &self, src: GraphPtr<'id, TreeNode<K, N, E>>, ) -> impl Iterator<Item = GraphItem<Edge<&N, &E>, GraphPtr<'id, TreeNode<K, N, E>>>>

Returns an iterator over edges attached to src node.

Source§

impl<'this, 'id, K, N: 'this, E: 'this, Root> AnchorMut<'this, 'id, GenericGraph<Root, TreeNode<K, N, E>>>
where Root: RootCollection<'static, TreeNode<K, N, E>> + 'this, K: Ord + 'this,

Source

pub fn edges_mut( &mut self, src: GraphPtr<'id, TreeNode<K, N, E>>, ) -> impl Iterator<Item = GraphItem<Edge<&mut N, &mut E>, GraphPtr<'id, TreeNode<K, N, E>>>>

Returns a mutable iterator over edges attached to src node.

Source

pub fn bridge( &mut self, src: GraphPtr<'id, TreeNode<K, N, E>>, dst: GraphPtr<'id, TreeNode<K, N, E>>, ) -> Option<(&mut TreeNode<'id, K, N, E>, &mut TreeNode<'id, K, 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, NodeType, Root> AnchorMut<'this, 'id, GenericGraph<Root, NodeType>>
where NodeType: GraphNode<Node = N> + 'this, Root: RootCollection<'static, NodeType> + 'this,

Source

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

pub fn cursor(&self, dst: GraphPtr<'id, NodeType>) -> Cursor<'_, 'id, NodeType>

Creates an immutable cursor pointing to dst

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,

Source

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.

Source

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.

Source

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,

Source

pub fn iter( &self, ) -> impl Iterator<Item = GraphItem<&N, GraphPtr<'id, NodeType>>>

Returns an iterator over data and pointers to nodes attached to the root.

Source

pub fn iter_mut( &mut self, ) -> impl Iterator<Item = GraphItem<&mut N, GraphPtr<'id, NodeType>>>

Returns a mutable iterator over data and pointers to nodes attached to the root.

Source§

impl<'this, 'id, N: 'this, NodeType> AnchorMut<'this, 'id, NamedGraph<NodeType>>
where NodeType: GraphNode<Node = N> + 'this,

Source

pub fn iter( &self, ) -> impl Iterator<Item = GraphItem<&N, GraphPtr<'id, NodeType>>>

Returns an iterator over data and pointers to nodes attached to the root.

Source

pub fn iter_mut( &mut self, ) -> impl Iterator<Item = GraphItem<&mut N, GraphPtr<'id, NodeType>>>

Returns a mutable iterator over data and pointers to nodes attached to the root.

Source§

impl<'this, 'id, N: 'this, NodeType> AnchorMut<'this, 'id, OptionGraph<NodeType>>
where NodeType: GraphNode<Node = N> + 'this,

Source

pub fn iter( &self, ) -> impl Iterator<Item = GraphItem<&N, GraphPtr<'id, NodeType>>>

Returns an iterator over data and pointers to nodes attached to the root.

Source

pub fn iter_mut( &mut self, ) -> impl Iterator<Item = GraphItem<&mut N, GraphPtr<'id, NodeType>>>

Returns a mutable iterator over data and pointers to nodes attached to the root.

Source§

impl<'this, 'id, N: 'this, NodeType> AnchorMut<'this, 'id, VecGraph<NodeType>>
where NodeType: GraphNode<Node = N> + 'this,

Source

pub fn root(&self) -> &RootVec<'id, NodeType>

Provides direct access to the collection of the root.

Source

pub fn root_mut(&mut self) -> &mut RootVec<'id, NodeType>

Provides direct mutable access to the collection of the root.

Source§

impl<'this, 'id, N: 'this, NodeType> AnchorMut<'this, 'id, NamedGraph<NodeType>>
where NodeType: GraphNode<Node = N> + 'this,

Source

pub fn root(&self) -> &RootNamedSet<'id, NodeType>

Provides direct access to the collection of the root.

Source

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,

Source

pub fn root(&self) -> &RootOption<'id, NodeType>

Provides direct access to the collection of the root.

Source

pub fn root_mut(&mut self) -> &mut RootOption<'id, NodeType>

Provides direct mutable access to the collection of the root.

Trait Implementations§

Source§

impl<'this, 'id, T> Drop for AnchorMut<'this, 'id, T>
where T: GraphImpl + 'this,

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<'this, 'id, N: 'this, E: 'this, Root> Index<GraphPtr<'id, NamedNode<N, E>>> for AnchorMut<'this, 'id, GenericGraph<Root, NamedNode<N, E>>>
where Root: RootCollection<'static, NamedNode<N, E>> + 'this,

Source§

type Output = NamedNode<'id, N, E>

The returned type after indexing.
Source§

fn index(&self, dst: GraphPtr<'id, NamedNode<N, E>>) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<'this, 'id, N: 'this, E: 'this, Root> Index<GraphPtr<'id, OptionNode<N, E>>> for AnchorMut<'this, 'id, GenericGraph<Root, OptionNode<N, E>>>
where Root: RootCollection<'static, OptionNode<N, E>> + 'this,

Source§

type Output = OptionNode<'id, N, E>

The returned type after indexing.
Source§

fn index(&self, dst: GraphPtr<'id, OptionNode<N, E>>) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<'this, 'id, K, N: 'this, E: 'this, Root> Index<GraphPtr<'id, TreeNode<K, N, E>>> for AnchorMut<'this, 'id, GenericGraph<Root, TreeNode<K, N, E>>>
where Root: RootCollection<'static, TreeNode<K, N, E>> + 'this, K: Ord + 'this,

Source§

type Output = TreeNode<'id, K, N, E>

The returned type after indexing.
Source§

fn index(&self, dst: GraphPtr<'id, TreeNode<K, N, E>>) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<'this, 'id, N: 'this, E: 'this, Root> Index<GraphPtr<'id, VecNode<N, E>>> for AnchorMut<'this, 'id, GenericGraph<Root, VecNode<N, E>>>
where Root: RootCollection<'static, VecNode<N, E>> + 'this,

Source§

type Output = VecNode<'id, N, E>

The returned type after indexing.
Source§

fn index(&self, dst: GraphPtr<'id, VecNode<N, E>>) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<'this, 'id, N: 'this, E: 'this, Root> IndexMut<GraphPtr<'id, NamedNode<N, E>>> for AnchorMut<'this, 'id, GenericGraph<Root, NamedNode<N, E>>>
where Root: RootCollection<'static, NamedNode<N, E>> + 'this,

Source§

fn index_mut( &mut self, dst: GraphPtr<'id, NamedNode<N, E>>, ) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<'this, 'id, N: 'this, E: 'this, Root> IndexMut<GraphPtr<'id, OptionNode<N, E>>> for AnchorMut<'this, 'id, GenericGraph<Root, OptionNode<N, E>>>
where Root: RootCollection<'static, OptionNode<N, E>> + 'this,

Source§

fn index_mut( &mut self, dst: GraphPtr<'id, OptionNode<N, E>>, ) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<'this, 'id, K, N: 'this, E: 'this, Root> IndexMut<GraphPtr<'id, TreeNode<K, N, E>>> for AnchorMut<'this, 'id, GenericGraph<Root, TreeNode<K, N, E>>>
where Root: RootCollection<'static, TreeNode<K, N, E>> + 'this, K: Ord + 'this,

Source§

fn index_mut( &mut self, dst: GraphPtr<'id, TreeNode<K, N, E>>, ) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<'this, 'id, N: 'this, E: 'this, Root> IndexMut<GraphPtr<'id, VecNode<N, E>>> for AnchorMut<'this, 'id, GenericGraph<Root, VecNode<N, E>>>
where Root: RootCollection<'static, VecNode<N, E>> + 'this,

Source§

fn index_mut(&mut self, dst: GraphPtr<'id, VecNode<N, E>>) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl<'this, 'id, T> Freeze for AnchorMut<'this, 'id, T>

§

impl<'this, 'id, T> RefUnwindSafe for AnchorMut<'this, 'id, T>
where T: RefUnwindSafe,

§

impl<'this, 'id, T> Send for AnchorMut<'this, 'id, T>
where T: Send,

§

impl<'this, 'id, T> Sync for AnchorMut<'this, 'id, T>
where T: Sync,

§

impl<'this, 'id, T> Unpin for AnchorMut<'this, 'id, T>

§

impl<'this, 'id, T> !UnwindSafe for AnchorMut<'this, 'id, T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.