Anchor

Struct Anchor 

Source
pub struct Anchor<'this, 'id, T>
where T: GraphImpl + 'this,
{ /* private fields */ }

Implementations§

Source§

impl<'this, 'id, N: 'this, E: 'this, Root> Anchor<'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> Anchor<'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> Anchor<'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, K, N: 'this, E: 'this, Root> Anchor<'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, N: 'this, NodeType, Root> Anchor<'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> Anchor<'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§

impl<'this, 'id, N: 'this, NodeType> Anchor<'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§

impl<'this, 'id, N: 'this, NodeType> Anchor<'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.

Trait Implementations§

Source§

impl<'this, 'id, N: 'this, E: 'this, Root> Index<GraphPtr<'id, NamedNode<N, E>>> for Anchor<'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 Anchor<'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 Anchor<'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 Anchor<'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

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

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

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.