[][src]Struct smallgraph::SmallGraph

pub struct SmallGraph<T> { /* fields omitted */ }

Methods

impl<T> SmallGraph<T>[src]

pub fn new() -> SmallGraph<T>[src]

Create a new SmallGraph

pub fn insert(&mut self, value: T) -> NodeHandle[src]

Insert a value into graph

pub fn connect_to(&mut self, parent: NodeHandle, child: NodeHandle)[src]

Create a directed connection between parent and child

pub fn neighbors(&self, node: NodeHandle) -> SmallVec<[NodeHandle; 8]>[src]

Get nodes this node has an edge to

pub fn nodes_with_neighbor(&self, node: NodeHandle) -> SmallVec<[NodeHandle; 8]>[src]

Get nodes that have an edge that can reach node

pub fn connect(&mut self, a: NodeHandle, b: NodeHandle)[src]

Create a two way connection between two nodes

pub fn disconnect_all(&mut self, n: NodeHandle)[src]

Disconnect all connections a node has

pub fn disconnect(&mut self, a: NodeHandle, b: NodeHandle)[src]

Disconnect all connections between two nodes

pub fn disconnect_from(&mut self, source: NodeHandle, destination: NodeHandle)[src]

Disconnect edge connection between source and destination

pub fn is_connected_to(
    &mut self,
    source: NodeHandle,
    destination: NodeHandle
) -> bool
[src]

Determine if there is a connection connection between a source and destination node

pub fn remove(&mut self, n: NodeHandle) -> Option<T>[src]

Remove a node and it's connections from graph

pub fn node_count(&self) -> usize[src]

Returns the count of nodes

pub fn get(&self, n: NodeHandle) -> Option<&T>[src]

Get the value of a node

pub fn get_mut(&mut self, n: NodeHandle) -> Option<&mut T>[src]

Get a mutable value of a node

Auto Trait Implementations

impl<T> Unpin for SmallGraph<T> where
    T: Unpin

impl<T> Send for SmallGraph<T> where
    T: Send

impl<T> Sync for SmallGraph<T> where
    T: Sync

Blanket Implementations

impl<T> From<T> for 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> Into<U> for T where
    U: From<T>, 
[src]

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.

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

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

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