[−][src]Struct smallgraph::SmallGraph
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]
&mut self,
source: NodeHandle,
destination: NodeHandle
) -> bool
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,
T: Unpin,
impl<T> Send for SmallGraph<T> where
T: Send,
T: Send,
impl<T> Sync for SmallGraph<T> where
T: Sync,
T: Sync,
Blanket Implementations
impl<T> From<T> for T
[src]
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> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,