Skip to main content

ForwardStitcher

Struct ForwardStitcher 

Source
pub struct ForwardStitcher<'d, 'a> { /* private fields */ }
Expand description

Extends walks from the references of one file, phase by phase, with the stored partial paths.

Implementations§

Source§

impl<'d, 'a> ForwardStitcher<'d, 'a>

Source

pub fn from_references( database: &'d PartialPathDatabase<'a>, file: &'a str, references: impl IntoIterator<Item = NodeId>, max_work: usize, ) -> Self

A stitcher whose walks start at those references of file that are references, and that tries at most max_work stored paths from each of them.

Source

pub fn process_next_phase(&mut self) -> Vec<StitchedPath<'a>>

Extends every pending walk by one stored path, and returns the walks that now reach a definition with no symbol left to find. A walk that reaches an import also goes on to what the import names. A walk that needs symbols on the stack before the reference is dropped, since a reference starts from an empty stack: at a root, no stored path that needs symbols below the reference is tried. A reference that runs out of work with stored paths left to try stops there and is reported by Self::exhausted.

Source

pub fn is_complete(&self) -> bool

Whether no walk is left to extend.

Source

pub fn exhausted(&self) -> impl Iterator<Item = NodeId> + '_

The references that stopped with stored paths left to try, in id order. A reference listed here may still have answers that were never found.

Source

pub fn work(&self) -> usize

The stored paths tried so far, over every reference.

Trait Implementations§

Source§

impl<'d, 'a> Debug for ForwardStitcher<'d, 'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'d, 'a> Forget for ForwardStitcher<'d, 'a>

§

impl<'d, 'a> Freeze for ForwardStitcher<'d, 'a>

§

impl<'d, 'a> RefUnwindSafe for ForwardStitcher<'d, 'a>

§

impl<'d, 'a> Send for ForwardStitcher<'d, 'a>

§

impl<'d, 'a> Sync for ForwardStitcher<'d, 'a>

§

impl<'d, 'a> Unpin for ForwardStitcher<'d, 'a>

§

impl<'d, 'a> UnsafeUnpin for ForwardStitcher<'d, 'a>

§

impl<'d, 'a> UnwindSafe for ForwardStitcher<'d, 'a>

Blanket Implementations§

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, 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>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.