pub struct ObligationForest<O: ForestObligation> { /* private fields */ }

Implementations§

source§

impl<O: ForestObligation> ObligationForest<O>

source

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 the std::<package>:: prefix of paths.
  • sed 's,"Binder(TraitPredicate(<\(.*\)>)) (\([^)]*\))","\1 (\2)",' — Transforms Binder(TraitPredicate(<predicate>)) into just <predicate>.
source§

impl<O: ForestObligation> ObligationForest<O>

source

pub fn new() -> ObligationForest<O>

source

pub fn len(&self) -> usize

Returns the total number of nodes in the forest that have not yet been fully resolved.

source

pub fn register_obligation(&mut self, obligation: O)

Registers an obligation.

source

pub fn to_errors<E: Clone>(&mut self, error: E) -> Vec<Error<O, E>>

Converts all remaining obligations to the given error.

source

pub fn map_pending_obligations<P, F>(&self, f: F) -> Vec<P>
where F: Fn(&O) -> P,

Returns the set of obligations that are in a pending state.

source

pub fn process_obligations<P>(&mut self, processor: &mut P) -> P::OUT
where 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>

§

type Node = usize

§

type Edge = (usize, usize)

source§

fn nodes(&self) -> Nodes<'_, Self::Node>

Returns all the nodes in this graph.
source§

fn edges(&self) -> Edges<'_, Self::Edge>

Returns all of the edges in this graph.
source§

fn source(&self, (s, _): &Self::Edge) -> Self::Node

The source node for edge.
source§

fn target(&self, (_, t): &Self::Edge) -> Self::Node

The target node for edge.
source§

impl<'a, O: ForestObligation + 'a> Labeller<'a> for &'a ObligationForest<O>

§

type Node = usize

§

type Edge = (usize, usize)

source§

fn graph_id(&self) -> Id<'_>

Must return a DOT compatible identifier naming the graph.
source§

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<'_>

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<'_>

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_shape(&'a self, _node: &Self::Node) -> Option<LabelText<'a>>

Maps n to one of the graphviz shape names. If None is returned, no shape attribute is specified.
source§

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

Maps e to a style that will be used in the rendered output.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Aligned for T

source§

const ALIGN: Alignment = const ALIGN: Alignment = Alignment::of::<Self>();

Alignment of Self.
source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<'a, T> Captures<'a> for T
where T: ?Sized,