CursorMut

Struct CursorMut 

Source
pub struct CursorMut<'this, 'id, T: 'this> { /* private fields */ }
Expand description

A wrapper over a GraphPtr which provides simplified access to AnchorMut API.

Implementations§

Source§

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

Source

pub fn at(&self) -> GraphPtr<'id, NodeType>

Returns a pointer to the current node the cursor points to.

Source

pub fn is_at(&self, dst: GraphPtr<'id, NodeType>) -> bool

Returns true if the cursor points to dst.

Source

pub fn jump(&mut self, dst: GraphPtr<'id, NodeType>)

Moves the cursor to dst.

Source§

impl<'this, 'id, N: 'this, E: 'this> CursorMut<'this, 'id, NamedNode<N, E>>

Source

pub fn get_edge( &self, dst: GraphPtr<'id, NamedNode<N, E>>, ) -> Option<Edge<&N, &E>>

Returns Some if dst is attached to the current node and None otherwise.

Source§

impl<'this, 'id, N: 'this, E: 'this> CursorMut<'this, 'id, VecNode<N, E>>

Source

pub fn get_edge(&self, dst: usize) -> Option<Edge<&N, &E>>

Returns Some if dst is attached to the current node and None otherwise.

Source§

impl<'this, 'id, N: 'this, E: 'this> CursorMut<'this, 'id, OptionNode<N, E>>

Source

pub fn get_edge(&self, _dst: ()) -> Option<Edge<&N, &E>>

Returns Some if a node is attached to the current node and None otherwise.

Source§

impl<'this, 'id, K, N: 'this, E: 'this> CursorMut<'this, 'id, TreeNode<K, N, E>>
where K: Ord + 'this,

Source

pub fn get_edge(&self, dst: &K) -> Option<Edge<&N, &E>>

Returns Some if a node is attached to the current node and None otherwise.

Source§

impl<'this, 'id, K, N: 'this, E: 'this> CursorMut<'this, 'id, TreeNode<K, N, E>>
where K: Ord + 'this,

Source

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

Returns an iterator over edges and node pointers attached to the current node.

Source§

impl<'this, 'id, N: 'this, E: 'this> CursorMut<'this, 'id, NamedNode<N, E>>

Source

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

Returns an iterator over edges and node pointers attached to the current node.

Source§

impl<'this, 'id, N: 'this, E: 'this> CursorMut<'this, 'id, VecNode<N, E>>

Source

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

Returns an iterator over edges and node pointers attached to the current node.

Source§

impl<'this, 'id, N: 'this, E: 'this> CursorMut<'this, 'id, OptionNode<N, E>>

Source

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

Returns an iterator over edges and node pointers attached to the current node.

Source§

impl<'this, 'id, N: 'this, E: 'this> CursorMut<'this, 'id, NamedNode<N, E>>

Source

pub fn get_edge_mut( &mut self, dst: GraphPtr<'id, NamedNode<N, E>>, ) -> Option<Edge<&mut N, &mut E>>

Returns Some if dst is attached to the current node and None otherwise.

Source§

impl<'this, 'id, N: 'this, E: 'this> CursorMut<'this, 'id, VecNode<N, E>>

Source

pub fn get_edge_mut(&mut self, dst: usize) -> Option<Edge<&mut N, &mut E>>

Returns Some if dst is attached to the current node and None otherwise.

Source§

impl<'this, 'id, N: 'this, E: 'this> CursorMut<'this, 'id, OptionNode<N, E>>

Source

pub fn get_edge_mut(&mut self, _key: ()) -> Option<Edge<&mut N, &mut E>>

Returns Some if a node is attached to the current node and None otherwise.

Source§

impl<'this, 'id, N: 'this, E: 'this> CursorMut<'this, 'id, NamedNode<N, E>>

Source

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

Returns a mutable iterator over edges and node pointers attached to the current node.

Source

pub fn bridge( &mut self, dst: GraphPtr<'id, NamedNode<N, E>>, ) -> Option<(&mut NamedNode<'id, N, E>, &mut NamedNode<'id, N, E>)>

Provides direct mutable access to current and dst nodes or or None if current is the same as dst. Returns mutable views into the current and dst nodes or None if current is the same as dst.

Source§

impl<'this, 'id, N: 'this, E: 'this> CursorMut<'this, 'id, VecNode<N, E>>

Source

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

Returns a mutable iterator over edges and node pointers attached to the current node.

Source

pub fn bridge( &mut self, dst: GraphPtr<'id, VecNode<N, E>>, ) -> Option<(&mut VecNode<'id, N, E>, &mut VecNode<'id, N, E>)>

Provides direct mutable access to current and dst nodes or or None if current is the same as dst. Returns mutable views into the current and dst nodes or None if current is the same as dst.

Source§

impl<'this, 'id, N: 'this, E: 'this> CursorMut<'this, 'id, OptionNode<N, E>>

Source

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

Returns a mutable iterator over edges and node pointers attached to the current node.

Source

pub fn bridge( &mut self, dst: GraphPtr<'id, OptionNode<N, E>>, ) -> Option<(&mut OptionNode<'id, N, E>, &mut OptionNode<'id, N, E>)>

Provides direct mutable access to current and dst nodes or or None if current is the same as dst. Returns mutable views into the current and dst nodes or None if current is the same as dst.

Source§

impl<'this, 'id, K, N: 'this, E: 'this> CursorMut<'this, 'id, TreeNode<K, N, E>>
where K: Ord + 'this,

Source

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

Returns a mutable iterator over edges and node pointers attached to the current node.

Source

pub fn bridge( &mut self, dst: GraphPtr<'id, TreeNode<K, N, E>>, ) -> Option<(&mut TreeNode<'id, K, N, E>, &mut TreeNode<'id, K, N, E>)>

Provides direct mutable access to current and dst nodes or or None if current is the same as dst. Returns mutable views into the current and dst nodes or None if current is the same as dst.

Trait Implementations§

Source§

impl<'this, 'id, N: 'this, E: 'this> Deref for CursorMut<'this, 'id, NamedNode<N, E>>

Source§

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

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'this, 'id, N: 'this, E: 'this> Deref for CursorMut<'this, 'id, OptionNode<N, E>>

Source§

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

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'this, 'id, K, N: 'this, E: 'this> Deref for CursorMut<'this, 'id, TreeNode<K, N, E>>
where K: Ord + 'this,

Source§

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

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'this, 'id, N: 'this, E: 'this> Deref for CursorMut<'this, 'id, VecNode<N, E>>

Source§

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

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'this, 'id, N: 'this, E: 'this> DerefMut for CursorMut<'this, 'id, NamedNode<N, E>>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<'this, 'id, N: 'this, E: 'this> DerefMut for CursorMut<'this, 'id, OptionNode<N, E>>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<'this, 'id, K, N: 'this, E: 'this> DerefMut for CursorMut<'this, 'id, TreeNode<K, N, E>>
where K: Ord + 'this,

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<'this, 'id, N: 'this, E: 'this> DerefMut for CursorMut<'this, 'id, VecNode<N, E>>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

§

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

§

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

§

impl<'this, 'id, T> !Send for CursorMut<'this, 'id, T>

§

impl<'this, 'id, T> !Sync for CursorMut<'this, 'id, T>

§

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

§

impl<'this, 'id, T> !UnwindSafe for CursorMut<'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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.