[−][src]Struct dynamic_graph::AnchorMut
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]
NodeType: GraphNode<Node = N, Edge = E>,
pub unsafe fn gptr_from_ptr(
&self,
raw: *const NodeType
) -> GraphPtr<'id, NodeType>
[src]
&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
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]
NodeType: GraphNode<Node = N, Edge = E>,
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]
&mut self,
dst: GraphPtr<'id, NodeType>
) -> CursorMut<'_, 'id, NodeType>
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]
&mut self,
src: GraphPtr<'id, NamedNode<N, E>>,
dst: GraphPtr<'id, NamedNode<N, E>>,
edge: E
)
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]
&mut self,
src: GraphPtr<'id, NamedNode<N, E>>,
dst: GraphPtr<'id, NamedNode<N, E>>
)
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]
&mut self,
dst: GraphPtr<'id, NamedNode<N, E>>
) -> &mut NamedNode<'id, N, E>
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]
NodeType: GraphNode<Node = N, Edge = E>,
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]
&mut self
) -> impl Iterator<Item = (&mut N, GraphPtr<'id, NodeType>)>
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]
NodeType: GraphNode<Node = N, Edge = E>,
type Output = N
The returned type after indexing.
fn index(&self, dst: GraphPtr<'id, NodeType>) -> &Self::Output
[src]
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]
NodeType: GraphNode<Node = N, Edge = E>,
Auto Trait Implementations
impl<'this, 'id, T> RefUnwindSafe for AnchorMut<'this, 'id, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<'this, 'id, T> Send for AnchorMut<'this, 'id, T> where
T: Send,
T: Send,
impl<'this, 'id, T> Sync for AnchorMut<'this, 'id, T> where
T: Sync,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,