pub struct Graph<N> {
pub graph: FxMapGraph,
pub inv_names: Vec<N>,
}Expand description
An adjacency list representation of a generic graph, including the
map required to go from node index to the original node name. The
N type parameter is the node name in the original graph, e.g.
BString for GFA graphs, or usize for graphs that use integer
names.
Fields§
§graph: FxMapGraph§inv_names: Vec<N>Implementations§
Source§impl Graph<usize>
impl Graph<usize>
Sourcepub fn from_edges<I>(input: I) -> Graph<usize>
pub fn from_edges<I>(input: I) -> Graph<usize>
Construct an adjacency graph from an iterator over the edges
of an existing graph. Both the input and output have usize
node IDs, but from_edges performs a transformation to ensure
all the node IDs are consecutive starting from 0.
Source§impl Graph<Vec<u8>>
impl Graph<Vec<u8>>
Sourcepub fn from_gfa_reader<T: BufRead>(reader: &mut T) -> Graph<Vec<u8>>
pub fn from_gfa_reader<T: BufRead>(reader: &mut T) -> Graph<Vec<u8>>
Constructs an adjacency list representation of the given GFA file input stream, parsing the GFA line-by-line and only keeping the links. Returns the graph as an adjacency list and a map from graph indices to GFA segment names.
Auto Trait Implementations§
impl<N> Freeze for Graph<N>
impl<N> RefUnwindSafe for Graph<N>where
N: RefUnwindSafe,
impl<N> Send for Graph<N>where
N: Send,
impl<N> Sync for Graph<N>where
N: Sync,
impl<N> Unpin for Graph<N>where
N: Unpin,
impl<N> UnwindSafe for Graph<N>where
N: UnwindSafe,
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