pub struct GraphAnalysis { /* private fields */ }
Expand description

Constructs a graph based representation of a component. Each node represents a ir::Port and each directed edge (X -> Y) means that X’s value written to Y.

Example

c.in = G[done] & b.done ? add.out

creates the edges:

add.out -> c.in
G[done] -> c.in
b.done -> c.in

This representation is useful for asking graph based queries such as all the reads from a port or all the write to a port.

Implementations

Returns an iterator over all the reads from a port. Returns an empty iterator if this is an Input port.

Returns an iterator over all the writes to this port. Returns an empty iterator if this is an Output port.

Add each edge in edges to the graph.

Return a topological sort of this graph.

Return a Vec of paths from start to finish, each path a Vec of ports.

Restricts the analysis graph to only include edges that are specified by the filter.

filter is passed references to the src and dst of each edge. When filter(src, dst) is true, then the edge between src and dst is kept. Otherwise, it is removed.

Returns all the Port associated with this instance.

Remove all vertices that have no undirected neighbors from the analysis graph.

Checks if there are cycles in the analysis graph.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts the given value to a String. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.