pub trait DomTree: DFSGraph + Sized {
type MutDomIter<'a>: Iterator<Item = &'a mut Option<Self::Identifier>>
where Self: 'a;
type PredecessorIter<'a>: Iterator<Item = Self::Identifier>
where Self: 'a;
// Required methods
fn dom(&self, id: Self::Identifier) -> Option<Self::Identifier>;
fn set_dom(
&mut self,
id: Self::Identifier,
target: Option<Self::Identifier>,
);
fn predecessor_iter(
&self,
id: Self::Identifier,
) -> Self::PredecessorIter<'_>;
fn doms_mut(&mut self) -> Self::MutDomIter<'_>;
// Provided methods
fn dom_iter(&self, id: Self::Identifier) -> DominatorIter<'_, Self> ⓘ { ... }
fn populate_dom(&mut self, root: Self::Identifier) { ... }
}Expand description
Interfaces related to Dominance Tree construction.
Required Associated Types§
Sourcetype MutDomIter<'a>: Iterator<Item = &'a mut Option<Self::Identifier>>
where
Self: 'a
type MutDomIter<'a>: Iterator<Item = &'a mut Option<Self::Identifier>> where Self: 'a
Self::MutDomIter is used in Self::doms_mut to get an iterator
over all nodes and return the mutable references to their immediate dominator identifiers.
Sourcetype PredecessorIter<'a>: Iterator<Item = Self::Identifier>
where
Self: 'a
type PredecessorIter<'a>: Iterator<Item = Self::Identifier> where Self: 'a
Self::PredecessorIter is similiar to DFSGraph::SuccessorIter, but it returns
incoming edges instead.
Required Methods§
Sourcefn dom(&self, id: Self::Identifier) -> Option<Self::Identifier>
fn dom(&self, id: Self::Identifier) -> Option<Self::Identifier>
Returns the identifier of the immediate dominator of the given node.
Sourcefn set_dom(&mut self, id: Self::Identifier, target: Option<Self::Identifier>)
fn set_dom(&mut self, id: Self::Identifier, target: Option<Self::Identifier>)
Updates the immediate dominator identifier of the given node.
Sourcefn predecessor_iter(&self, id: Self::Identifier) -> Self::PredecessorIter<'_>
fn predecessor_iter(&self, id: Self::Identifier) -> Self::PredecessorIter<'_>
Returns an iterator over the incoming edges of the given node.
Sourcefn doms_mut(&mut self) -> Self::MutDomIter<'_>
fn doms_mut(&mut self) -> Self::MutDomIter<'_>
Returns an iterator over all nodes which yields the mutable references to their immediate dominator identifiers.
Provided Methods§
Sourcefn dom_iter(&self, id: Self::Identifier) -> DominatorIter<'_, Self> ⓘ
fn dom_iter(&self, id: Self::Identifier) -> DominatorIter<'_, Self> ⓘ
Returns an iterator over all the strict dominators of a node.
Sourcefn populate_dom(&mut self, root: Self::Identifier)
fn populate_dom(&mut self, root: Self::Identifier)
Calculate all the immediate dominator for all nodes. This will form the dominator tree.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.