pub struct SerializableGraph { /* private fields */ }Expand description
Serializable representation of FxGraph
Implementations§
Source§impl SerializableGraph
impl SerializableGraph
Sourcepub fn from_graph(graph: &FxGraph) -> Self
pub fn from_graph(graph: &FxGraph) -> Self
Convert FxGraph to serializable format
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Get the number of nodes in the graph
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Get the number of edges in the graph
Sourcepub fn validate(&self) -> TorshResult<()>
pub fn validate(&self) -> TorshResult<()>
Basic validation of the graph structure
Sourcepub fn operation_counts(&self) -> HashMap<String, usize>
pub fn operation_counts(&self) -> HashMap<String, usize>
Count operations by type
Sourcepub fn is_linear_chain(&self) -> bool
pub fn is_linear_chain(&self) -> bool
Check if the graph is a linear chain
Sourcepub fn has_cycles(&self) -> bool
pub fn has_cycles(&self) -> bool
Check if the graph has cycles
Sourcepub fn find_orphaned_nodes(&self) -> Vec<usize>
pub fn find_orphaned_nodes(&self) -> Vec<usize>
Find orphaned nodes (nodes with no incoming or outgoing edges)
Sourcepub fn find_dead_end_nodes(&self) -> Vec<usize>
pub fn find_dead_end_nodes(&self) -> Vec<usize>
Find dead-end nodes (nodes that don’t lead to any output)
Sourcepub fn call_nodes(&self) -> Vec<usize>
pub fn call_nodes(&self) -> Vec<usize>
Get all call nodes
Sourcepub fn metrics(&self) -> GraphMetrics
pub fn metrics(&self) -> GraphMetrics
Graph metrics for analysis
Sourcepub fn add_output(&mut self, idx: usize)
pub fn add_output(&mut self, idx: usize)
Add an output node index
Sourcepub fn sequential_ops(ops: &[&str]) -> Self
pub fn sequential_ops(ops: &[&str]) -> Self
Create a sequential chain of operations
Trait Implementations§
Source§impl Clone for SerializableGraph
impl Clone for SerializableGraph
Source§fn clone(&self) -> SerializableGraph
fn clone(&self) -> SerializableGraph
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SerializableGraph
impl Debug for SerializableGraph
Source§impl<'de> Deserialize<'de> for SerializableGraph
impl<'de> Deserialize<'de> for SerializableGraph
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SerializableGraph
impl RefUnwindSafe for SerializableGraph
impl Send for SerializableGraph
impl Sync for SerializableGraph
impl Unpin for SerializableGraph
impl UnsafeUnpin for SerializableGraph
impl UnwindSafe for SerializableGraph
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