SuspendedGenerator

Struct SuspendedGenerator 

Source
pub struct SuspendedGenerator<V, R> { /* private fields */ }
Expand description

A suspended generator.

A suspended generator is like a normal generator with the minimal vertex moved out of the generator. This state results when a TryRamify implementation returns an error.

Iteration can be resumed, which requires specifying an iterator over children manually.

Implementations§

Source§

impl<V, R> SuspendedGenerator<V, R>

Source

pub fn resume<I, W: DiagramWrite>( self, writer: &mut W, children: I, ) -> Result<Generator<V, R>, W::Error>
where R: TryRamify<V>, I: IntoIterator<Item = V>,

Recover from an error and resume iteration.

This writes the current minimal vertex and updates the internal state to hold the provided children. The end result is equivalent to the TryRamify implementation succeeding and yielding the provided children.

Source

pub fn into_active_vertices(self) -> impl ExactSizeIterator<Item = V>

Consume the suspended generator, returning an iterator over the active vertices in an unspecified order.

Source

pub fn peek_annotation(&self) -> &str

Returns the annotation that will be written if iteration is resumed.

Auto Trait Implementations§

§

impl<V, R> Freeze for SuspendedGenerator<V, R>
where R: Freeze,

§

impl<V, R> RefUnwindSafe for SuspendedGenerator<V, R>

§

impl<V, R> Send for SuspendedGenerator<V, R>
where R: Send, V: Send,

§

impl<V, R> Sync for SuspendedGenerator<V, R>
where R: Sync, V: Sync,

§

impl<V, R> Unpin for SuspendedGenerator<V, R>
where R: Unpin, V: Unpin,

§

impl<V, R> UnwindSafe for SuspendedGenerator<V, R>
where R: UnwindSafe, V: UnwindSafe,

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 = 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.