Struct CandidateChain

Source
pub struct CandidateChain<'a> { /* private fields */ }
Expand description

A sequence of nodes that might come next in the file.

While interactively resolving the order of a file, there could be several choices for the next node (let’s call these candidates). Moreover, each candidate might have a sequence of nodes that naturally (but don’t necessarily) come after it. This candidate, plus the sequence of nodes that follow it, make up a CandidateChain.

For example, suppose we have a graggle like this:

   -> B -> C -> D
 /               \
A                 -> H
 \               /
   -> E -> F -> G

If A has already been chosen then B would be the head of a candidate chain containing B, C, and D.

Implementations§

Source§

impl<'a> CandidateChain<'a>

Source

pub fn first(&self) -> NodeId

Returns the first element of this chain.

Source

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

Returns an iterator over all elements of this chain (including the first).

Auto Trait Implementations§

§

impl<'a> Freeze for CandidateChain<'a>

§

impl<'a> RefUnwindSafe for CandidateChain<'a>

§

impl<'a> Send for CandidateChain<'a>

§

impl<'a> Sync for CandidateChain<'a>

§

impl<'a> Unpin for CandidateChain<'a>

§

impl<'a> UnwindSafe for CandidateChain<'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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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

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.