pub struct CodeGraph { /* private fields */ }Expand description
Code graph representation
Implementations§
Source§impl CodeGraph
impl CodeGraph
Sourcepub fn add_node(&mut self, node: CodeGraphNode) -> usize
pub fn add_node(&mut self, node: CodeGraphNode) -> usize
Add a node to the graph
Sourcepub fn add_edge(&mut self, edge: CodeGraphEdge)
pub fn add_edge(&mut self, edge: CodeGraphEdge)
Add an edge to the graph
Sourcepub fn node(&self, idx: usize) -> Option<&CodeGraphNode>
pub fn node(&self, idx: usize) -> Option<&CodeGraphNode>
Get a node by index
Sourcepub fn nodes(&self) -> &[CodeGraphNode]
pub fn nodes(&self) -> &[CodeGraphNode]
Get all nodes
Sourcepub fn edges(&self) -> &[CodeGraphEdge]
pub fn edges(&self) -> &[CodeGraphEdge]
Get all edges
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CodeGraph
impl RefUnwindSafe for CodeGraph
impl Send for CodeGraph
impl Sync for CodeGraph
impl Unpin for CodeGraph
impl UnsafeUnpin for CodeGraph
impl UnwindSafe for CodeGraph
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more