pub struct Graph<N, E, G>{ /* private fields */ }Implementations§
Source§impl<N, E, G> Graph<N, E, G>
impl<N, E, G> Graph<N, E, G>
pub fn compact_if_sparse(&mut self, max_capacity_factor: f64) -> bool
pub fn new(options: GraphOptions) -> Self
pub fn with_capacity( options: GraphOptions, node_capacity: usize, edge_capacity: usize, ) -> Self
pub fn options(&self) -> GraphOptions
pub fn is_multigraph(&self) -> bool
pub fn is_compound(&self) -> bool
pub fn is_directed(&self) -> bool
pub fn set_graph(&mut self, label: G) -> &mut Self
pub fn graph(&self) -> &G
pub fn graph_mut(&mut self) -> &mut G
pub fn set_default_node_label<F>(&mut self, f: F) -> &mut Self
pub fn set_default_edge_label<F>(&mut self, f: F) -> &mut Self
pub fn has_node(&self, id: &str) -> bool
pub fn node_ix(&self, id: &str) -> Option<usize>
pub fn node_id_by_ix(&self, ix: usize) -> Option<&str>
pub fn node_label_by_ix(&self, ix: usize) -> Option<&N>
pub fn node_label_mut_by_ix(&mut self, ix: usize) -> Option<&mut N>
pub fn has_edge_ix(&self, v_ix: usize, w_ix: usize) -> bool
pub fn edge_by_endpoints_ix(&self, v_ix: usize, w_ix: usize) -> Option<&E>
pub fn set_node(&mut self, id: impl Into<String>, label: N) -> &mut Self
pub fn ensure_node(&mut self, id: impl Into<String>) -> &mut Self
pub fn ensure_node_ref(&mut self, id: &str) -> &mut Self
pub fn node(&self, id: &str) -> Option<&N>
pub fn node_mut(&mut self, id: &str) -> Option<&mut N>
pub fn node_count(&self) -> usize
pub fn nodes(&self) -> impl Iterator<Item = &str>
pub fn node_ids(&self) -> Vec<String>
pub fn edge_count(&self) -> usize
pub fn edge_key_by_ix(&self, edge_ix: usize) -> Option<&EdgeKey>
pub fn edges(&self) -> impl Iterator<Item = &EdgeKey>
pub fn for_each_edge<F>(&self, f: F)
pub fn for_each_edge_ix<F>(&self, f: F)
pub fn for_each_edge_entry_ix<F>(&self, f: F)
pub fn for_each_edge_mut<F>(&mut self, f: F)
pub fn for_each_node<F>(&self, f: F)
pub fn for_each_node_ix<F>(&self, f: F)
pub fn for_each_node_mut<F>(&mut self, f: F)
pub fn edge_keys(&self) -> Vec<EdgeKey>
pub fn set_edge( &mut self, v: impl Into<String>, w: impl Into<String>, ) -> &mut Self
pub fn set_edge_with_label( &mut self, v: impl Into<String>, w: impl Into<String>, label: E, ) -> &mut Self
pub fn set_edge_named( &mut self, v: impl Into<String>, w: impl Into<String>, name: Option<impl Into<String>>, label: Option<E>, ) -> &mut Self
pub fn set_path(&mut self, nodes: &[&str]) -> &mut Self
pub fn has_edge(&self, v: &str, w: &str, name: Option<&str>) -> bool
pub fn edge(&self, v: &str, w: &str, name: Option<&str>) -> Option<&E>
pub fn edge_mut( &mut self, v: &str, w: &str, name: Option<&str>, ) -> Option<&mut E>
pub fn edge_by_key(&self, key: &EdgeKey) -> Option<&E>
pub fn edge_mut_by_key(&mut self, key: &EdgeKey) -> Option<&mut E>
pub fn remove_edge_key(&mut self, key: &EdgeKey) -> bool
pub fn remove_edge(&mut self, v: &str, w: &str, name: Option<&str>) -> bool
pub fn remove_node(&mut self, id: &str) -> bool
pub fn successors(&self, v: &str) -> Vec<&str>
pub fn predecessors(&self, v: &str) -> Vec<&str>
pub fn first_successor<'a>(&'a self, v: &str) -> Option<&'a str>
pub fn first_predecessor<'a>(&'a self, v: &str) -> Option<&'a str>
pub fn extend_successors<'a>(&'a self, v: &str, out: &mut Vec<&'a str>)
pub fn extend_predecessors<'a>(&'a self, v: &str, out: &mut Vec<&'a str>)
pub fn for_each_successor<'a, F>(&'a self, v: &str, f: F)
pub fn for_each_predecessor<'a, F>(&'a self, v: &str, f: F)
pub fn neighbors(&self, v: &str) -> Vec<&str>
pub fn out_edges(&self, v: &str, w: Option<&str>) -> Vec<EdgeKey>
pub fn in_edges(&self, v: &str, w: Option<&str>) -> Vec<EdgeKey>
pub fn for_each_out_edge<F>(&self, v: &str, w: Option<&str>, f: F)
pub fn for_each_in_edge<F>(&self, v: &str, w: Option<&str>, f: F)
pub fn set_edge_key(&mut self, key: EdgeKey, label: E) -> &mut Self
pub fn for_each_out_edge_ix<F>(&self, v_ix: usize, w_ix: Option<usize>, f: F)
pub fn for_each_out_edge_entry_ix<F>( &self, v_ix: usize, w_ix: Option<usize>, f: F, )
pub fn for_each_neighbor_ix<F>(&self, v_ix: usize, f: F)
pub fn for_each_in_edge_ix<F>(&self, v_ix: usize, w_ix: Option<usize>, f: F)
pub fn for_each_in_edge_entry_ix<F>( &self, v_ix: usize, w_ix: Option<usize>, f: F, )
pub fn set_parent( &mut self, child: impl Into<String>, parent: impl Into<String>, ) -> &mut Self
pub fn set_parent_ref(&mut self, child: &str, parent: &str) -> &mut Self
pub fn set_parent_ix(&mut self, child_ix: usize, parent_ix: usize) -> &mut Self
pub fn clear_parent(&mut self, child: &str) -> &mut Self
pub fn parent(&self, child: &str) -> Option<&str>
pub fn children_iter<'a>( &'a self, parent: &str, ) -> impl Iterator<Item = &'a str> + 'a
pub fn children(&self, parent: &str) -> Vec<&str>
pub fn children_root(&self) -> Vec<&str>
pub fn sources(&self) -> Vec<&str>
pub fn node_edges(&self, v: &str) -> Vec<EdgeKey>
Auto Trait Implementations§
impl<N, E, G> !Freeze for Graph<N, E, G>
impl<N, E, G> !RefUnwindSafe for Graph<N, E, G>
impl<N, E, G> Send for Graph<N, E, G>
impl<N, E, G> !Sync for Graph<N, E, G>
impl<N, E, G> Unpin for Graph<N, E, G>
impl<N, E, G> UnsafeUnpin for Graph<N, E, G>where
G: UnsafeUnpin,
impl<N, E, G> !UnwindSafe for Graph<N, E, G>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more