Trait bones_framework::prelude::piccolo::callback::Sequence
pub trait Sequence<'gc>: Collect {
// Required method
fn poll(
&mut self,
ctx: Context<'gc>,
exec: Execution<'gc, '_>,
stack: Stack<'gc, '_>,
) -> Result<SequencePoll<'gc>, Error<'gc>>;
// Provided method
fn error(
&mut self,
_ctx: Context<'gc>,
_exec: Execution<'gc, '_>,
error: Error<'gc>,
_stack: Stack<'gc, '_>,
) -> Result<SequencePoll<'gc>, Error<'gc>> { ... }
}
Required Methods§
fn poll(
&mut self,
ctx: Context<'gc>,
exec: Execution<'gc, '_>,
stack: Stack<'gc, '_>,
) -> Result<SequencePoll<'gc>, Error<'gc>>
fn poll( &mut self, ctx: Context<'gc>, exec: Execution<'gc, '_>, stack: Stack<'gc, '_>, ) -> Result<SequencePoll<'gc>, Error<'gc>>
Called when a Sequence
is first run with the stack unchanged from the returned Callback
that spawned it.
If a sub-function is called and succeeds, this will be called when that function finishes successfully with its return values.
If the Sequence
yields values, this will suspend the containing coroutine and
Sequence::poll
will be called again with the resume parameters.