pub struct MirGraph { /* private fields */ }Implementations§
Source§impl MirGraph
impl MirGraph
pub fn new(root: MirNodeKind) -> Self
pub const fn root(&self) -> NodeIndex
pub const fn graph(&self) -> &Graph<MirNodeKind, MirEdgeKind>
pub fn node_count(&self) -> usize
pub fn root_kind(&self) -> &MirNodeKind
pub fn node_kinds(&self) -> impl Iterator<Item = &MirNodeKind>
pub fn set_root(&mut self, root: NodeIndex)
pub fn add_input(&mut self, from: NodeIndex, to: NodeIndex)
pub fn add_cte_expansion(&mut self, from: NodeIndex, to: NodeIndex)
pub fn add_node(&mut self, node: MirNodeKind) -> NodeIndex
pub fn append_graph(&mut self, other: &Self) -> NodeIndex
Sourcepub fn splice_above(
&mut self,
target: NodeIndex,
kind: MirNodeKind,
) -> NodeIndex
pub fn splice_above( &mut self, target: NodeIndex, kind: MirNodeKind, ) -> NodeIndex
Inserts kind immediately above target, redirecting every
outgoing edge from target (i.e. each consumer that read from
target) to read from the newly-spliced node instead. The new
node receives a single incoming Input edge from target.
If target was the graph root, the spliced node becomes the new
root.
Returns the index of the newly-inserted node.
Sourcepub fn base_table_indices(&self) -> Vec<NodeIndex>
pub fn base_table_indices(&self) -> Vec<NodeIndex>
Returns every node index whose payload is a BaseTable.
Sourcepub fn node_kind(&self, index: NodeIndex) -> &MirNodeKind
pub fn node_kind(&self, index: NodeIndex) -> &MirNodeKind
Returns the kind stored at index.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MirGraph
impl RefUnwindSafe for MirGraph
impl Send for MirGraph
impl Sync for MirGraph
impl Unpin for MirGraph
impl UnsafeUnpin for MirGraph
impl UnwindSafe for MirGraph
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