[][src]Struct dynamic_graph::AnchorMut

pub struct AnchorMut<'this, 'id: 'this, T: 'this> { /* fields omitted */ }

Methods

impl<'this, 'id: 'this, N: 'this, E: 'this, NodeType: 'this, Root: 'this> AnchorMut<'this, 'id, GenericGraph<Root, NodeType>> where
    NodeType: GraphNode<Node = N, Edge = E>, 
[src]

pub unsafe fn gptr_from_ptr(
    &self,
    raw: *const NodeType
) -> GraphPtr<'id, NodeType>
[src]

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

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

Creates an immutable cursor pointing to dst

impl<'this, 'id: 'this, N: 'this, E: 'this, NodeType: 'this, Root: 'this> AnchorMut<'this, 'id, GenericGraph<Root, NodeType>> where
    NodeType: GraphNode<Node = N, Edge = E>, 
[src]

pub fn spawn_detached(&mut self, payload: N) -> GraphPtr<'id, NodeType>[src]

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 root or another node accessible from the root.

pub fn cursor_mut(
    &mut self,
    dst: GraphPtr<'id, NodeType>
) -> CursorMut<'_, 'id, NodeType>
[src]

Creates a mutable cursor pointing to dst.

impl<'this, 'id: 'this, N: 'this, E: 'this, Root: 'this> AnchorMut<'this, 'id, GenericGraph<Root, NamedNode<N, E>>>[src]

pub fn connect(
    &mut self,
    src: GraphPtr<'id, NamedNode<N, E>>,
    dst: GraphPtr<'id, NamedNode<N, E>>,
    edge: E
)
[src]

Creates an edge from src to dst with the value edge.

pub fn disconnect(
    &mut self,
    src: GraphPtr<'id, NamedNode<N, E>>,
    dst: GraphPtr<'id, NamedNode<N, E>>
)
[src]

Removes an edge from src to dst.

pub fn view(&self, dst: GraphPtr<'id, NamedNode<N, E>>) -> &NamedNode<'id, N, E>[src]

Provides direct access to the contents of the dst node. !!! Relies on undefined behavior and should not be used !!!

pub fn view_mut(
    &mut self,
    dst: GraphPtr<'id, NamedNode<N, E>>
) -> &mut NamedNode<'id, N, E>
[src]

Provides mutable direct access to the contents of the dst node. !!! Relies on undefined behavior and should not be used !!!

impl<'this, 'id: 'this, N: 'this, E: 'this, NodeType: 'this> AnchorMut<'this, 'id, VecGraph<NodeType>> where
    NodeType: GraphNode<Node = N, Edge = E>, 
[src]

pub fn spawn(&mut self, payload: N) -> GraphPtr<'id, NodeType>[src]

Allocates a new node and returns the pointer. Attaches the node to the root.

pub fn root(&self) -> &Vec<GraphPtr<'id, NodeType>>[src]

Provides safe direct access to the collection of the root. !!! Relies on undefined behavior and should not be used !!!

pub fn root_mut(&mut self) -> &mut Vec<GraphPtr<'id, NodeType>>[src]

Provides safe mutable direct access to the collection of the root. !!! Relies on undefined behavior and should not be used !!!

pub fn attach(&mut self, dst: GraphPtr<'id, NodeType>)[src]

Attaches dst to the root using Vec::push.

pub fn detach(&mut self, index: usize)[src]

Detaches a node from the root using Vec::swap_remove.

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

Returns an iterator over payloads and node pointers attached to the root.

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

Returns a mutable iterator over payloads and node pointers attached to the root.

Trait Implementations

impl<'this, 'id: 'this, T: 'this> Drop for AnchorMut<'this, 'id, T>[src]

impl<'this, 'id: 'this, N: 'this, E: 'this, NodeType: 'this, Root: 'this> Index<GraphPtr<'id, NodeType>> for AnchorMut<'this, 'id, GenericGraph<Root, NodeType>> where
    NodeType: GraphNode<Node = N, Edge = E>, 
[src]

type Output = N

The returned type after indexing.

impl<'this, 'id: 'this, N: 'this, E: 'this, NodeType: 'this, Root: 'this> IndexMut<GraphPtr<'id, NodeType>> for AnchorMut<'this, 'id, GenericGraph<Root, NodeType>> where
    NodeType: GraphNode<Node = N, Edge = E>, 
[src]

Auto Trait Implementations

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.