pub struct ObligationForest<O: ForestObligation> { /* private fields */ }
Implementations§
source§impl<O: ForestObligation> ObligationForest<O>
impl<O: ForestObligation> ObligationForest<O>
sourcepub fn dump_graphviz<P: AsRef<Path>>(&self, dir: P, description: &str)
pub fn dump_graphviz<P: AsRef<Path>>(&self, dir: P, description: &str)
Creates a graphviz representation of the obligation forest. Given a directory this will
create files with name of the format <counter>_<description>.gv
. The counter is
global and is maintained internally.
Calling this will do nothing unless the environment variable
DUMP_OBLIGATION_FOREST_GRAPHVIZ
is defined.
A few post-processing that you might want to do make the forest easier to visualize:
sed 's,std::[a-z]*::,,g'
— Deletes thestd::<package>::
prefix of paths.sed 's,"Binder(TraitPredicate(<\(.*\)>)) (\([^)]*\))","\1 (\2)",'
— TransformsBinder(TraitPredicate(<predicate>))
into just<predicate>
.
source§impl<O: ForestObligation> ObligationForest<O>
impl<O: ForestObligation> ObligationForest<O>
pub fn new() -> ObligationForest<O>
sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the total number of nodes in the forest that have not yet been fully resolved.
sourcepub fn register_obligation(&mut self, obligation: O)
pub fn register_obligation(&mut self, obligation: O)
Registers an obligation.
sourcepub fn to_errors<E: Clone>(&mut self, error: E) -> Vec<Error<O, E>>
pub fn to_errors<E: Clone>(&mut self, error: E) -> Vec<Error<O, E>>
Converts all remaining obligations to the given error.
sourcepub fn map_pending_obligations<P, F>(&self, f: F) -> Vec<P>
pub fn map_pending_obligations<P, F>(&self, f: F) -> Vec<P>
Returns the set of obligations that are in a pending state.
sourcepub fn process_obligations<P>(&mut self, processor: &mut P) -> P::OUTwhere
P: ObligationProcessor<Obligation = O>,
pub fn process_obligations<P>(&mut self, processor: &mut P) -> P::OUTwhere
P: ObligationProcessor<Obligation = O>,
Performs a fixpoint computation over the obligation list.
Trait Implementations§
source§impl<'a, O: ForestObligation + 'a> GraphWalk<'a> for &'a ObligationForest<O>
impl<'a, O: ForestObligation + 'a> GraphWalk<'a> for &'a ObligationForest<O>
source§impl<'a, O: ForestObligation + 'a> Labeller<'a> for &'a ObligationForest<O>
impl<'a, O: ForestObligation + 'a> Labeller<'a> for &'a ObligationForest<O>
type Node = usize
type Edge = (usize, usize)
source§fn node_id(&self, index: &Self::Node) -> Id<'_>
fn node_id(&self, index: &Self::Node) -> Id<'_>
Maps
n
to a unique identifier with respect to self
. The
implementor is responsible for ensuring that the returned name
is a valid DOT identifier.source§fn node_label(&self, index: &Self::Node) -> LabelText<'_>
fn node_label(&self, index: &Self::Node) -> LabelText<'_>
Maps
n
to a label that will be used in the rendered output.
The label need not be unique, and may be the empty string; the
default is just the output from node_id
.source§fn edge_label(
&self,
(_index_source, _index_target): &Self::Edge
) -> LabelText<'_>
fn edge_label( &self, (_index_source, _index_target): &Self::Edge ) -> LabelText<'_>
Maps
e
to a label that will be used in the rendered output.
The label need not be unique, and may be the empty string; the
default is in fact the empty string.source§fn node_style(&'a self, _n: &Self::Node) -> Style
fn node_style(&'a self, _n: &Self::Node) -> Style
Maps
n
to a style that will be used in the rendered output.source§fn edge_style(&'a self, _e: &Self::Edge) -> Style
fn edge_style(&'a self, _e: &Self::Edge) -> Style
Maps
e
to a style that will be used in the rendered output.Auto Trait Implementations§
impl<O> !RefUnwindSafe for ObligationForest<O>
impl<O> Send for ObligationForest<O>
impl<O> !Sync for ObligationForest<O>
impl<O> Unpin for ObligationForest<O>
impl<O> UnwindSafe for ObligationForest<O>
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