Skip to main content

Sequence

Trait Sequence 

Source
pub trait Sequence<'gc>: Collect {
    type Output;

    // Required method
    fn step(&mut self, mc: MutationContext<'gc, '_>) -> Option<Self::Output>;
}
Expand description

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.

Required Associated Types§

Required Methods§

Source

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

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

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

Source§

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

Source§

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

Implementors§

Source§

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

Source§

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

Source§

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

Source§

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

Source§

type Output = Result<R, E>

Source§

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,

Source§

type Output = Result<R, E>

Source§

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,

Source§

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,

Source§

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

Source§

type Output = Result<R, E>

Source§

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,

Source§

type Output = Result<I, R>

Source§

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,

Source§

type Output = Result<R, E>

Source§

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

Source§

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,

Source§

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

Source§

type Output = Result<I2, E>

Source§

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

Source§

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