[][src]Trait gc_sequence::Sequence

pub trait Sequence<'gc>: Collect {
type Output;
    fn step(&mut self, mc: MutationContext<'gc, '_>) -> Option<Self::Output>;
}

A trait that describes a sequence of actions to perform, in between which garbage collection may take place.

This trait is similar to the Future trait in that it is not designed to be used directly, but rather chained together using combinators and run to completion with a sequencer.

Associated Types

type Output

Loading content...

Required methods

fn step(&mut self, mc: MutationContext<'gc, '_>) -> Option<Self::Output>

Loading content...

Implementations on Foreign Types

impl<'gc, T: ?Sized + Sequence<'gc>> Sequence<'gc> for Box<T>[src]

type Output = T::Output

Loading content...

Implementors

impl<'gc, C, F, R> Sequence<'gc> for SequenceFnWith<C, F> where
    F: 'static + FnOnce(MutationContext<'gc, '_>, C) -> R,
    C: Collect
[src]

type Output = R

impl<'gc, F, R> Sequence<'gc> for SequenceFn<F> where
    F: 'static + FnOnce(MutationContext<'gc, '_>) -> R, 
[src]

type Output = R

impl<'gc, O: Collect> Sequence<'gc> for Done<O>[src]

type Output = O

impl<'gc, S> Sequence<'gc> for Flatten<'gc, S> where
    S: Sequence<'gc>,
    S::Output: Sequence<'gc>, 
[src]

type Output = <S::Output as Sequence<'gc>>::Output

impl<'gc, S, C, F, I, E, R> Sequence<'gc> for AndThenWith<S, C, F, I> where
    S: Sequence<'gc, Output = Result<I, E>>,
    C: Collect,
    I: Collect,
    F: 'static + FnOnce(MutationContext<'gc, '_>, C, I) -> Result<R, E>, 
[src]

type Output = Result<R, E>

impl<'gc, S, C, F, I, E, R> Sequence<'gc> for MapOkWith<S, C, F> where
    S: Sequence<'gc, Output = Result<I, E>>,
    C: Collect,
    F: 'static + FnOnce(C, I) -> R, 
[src]

type Output = Result<R, E>

impl<'gc, S, C, F, R> Sequence<'gc> for ThenWith<'gc, S, C, F> where
    S: Sequence<'gc>,
    S::Output: Collect,
    C: Collect,
    F: 'static + FnOnce(MutationContext<'gc, '_>, C, S::Output) -> R, 
[src]

type Output = R

impl<'gc, S, C, F, R> Sequence<'gc> for MapWith<S, C, F> where
    S: Sequence<'gc>,
    C: Collect,
    F: 'static + FnOnce(C, S::Output) -> R, 
[src]

type Output = R

impl<'gc, S, F, I, E, R> Sequence<'gc> for AndThen<S, F, I> where
    S: Sequence<'gc, Output = Result<I, E>>,
    I: Collect,
    F: 'static + FnOnce(MutationContext<'gc, '_>, I) -> Result<R, E>, 
[src]

type Output = Result<R, E>

impl<'gc, S, F, I, E, R> Sequence<'gc> for MapError<S, F> where
    S: Sequence<'gc, Output = Result<I, E>>,
    F: 'static + FnOnce(E) -> R, 
[src]

type Output = Result<I, R>

impl<'gc, S, F, I, E, R> Sequence<'gc> for MapOk<S, F> where
    S: Sequence<'gc, Output = Result<I, E>>,
    F: 'static + FnOnce(I) -> R, 
[src]

type Output = Result<R, E>

impl<'gc, S, F, R> Sequence<'gc> for Then<'gc, S, F> where
    S: Sequence<'gc>,
    S::Output: Collect,
    F: 'static + FnOnce(MutationContext<'gc, '_>, S::Output) -> R, 
[src]

type Output = R

impl<'gc, S, F, R> Sequence<'gc> for Map<S, F> where
    S: Sequence<'gc>,
    F: 'static + FnOnce(S::Output) -> R, 
[src]

type Output = R

impl<'gc, S, I, E, I2> Sequence<'gc> for FlattenOk<S, I> where
    S: Sequence<'gc, Output = Result<I, E>>,
    I: Sequence<'gc, Output = Result<I2, E>>, 
[src]

type Output = Result<I2, E>

Loading content...