Struct reblessive::Stk
source · pub struct Stk(/* private fields */);
Expand description
A reference back to stack from inside the running future.
Used for spawning new futures onto the stack from a future running on the stack.
Implementations§
source§impl Stk
impl Stk
sourcepub fn run<'a, F, Fut, R>(&'a mut self, f: F) -> StkFuture<'a, F, R> ⓘ
pub fn run<'a, F, Fut, R>(&'a mut self, f: F) -> StkFuture<'a, F, R> ⓘ
Run a new future in the runtime.
sourcepub fn enter_run<'a, F, Fut, R>(f: F) -> StkFuture<'a, F, R> ⓘ
pub fn enter_run<'a, F, Fut, R>(f: F) -> StkFuture<'a, F, R> ⓘ
A less type save version of Stk::run which doesn’t require passing arround a Stk object. Invalid use of this function will cause a panic, deadlock or otherwise generally sound but strange behaviour.
§Panic
This function will panic while not within a Stack The future returned by this function will panic if another stack futures is created which is not contained within the future returned by this function while the current future is still running
sourcepub fn yield_now(&mut self) -> YieldFuture<'_> ⓘ
pub fn yield_now(&mut self) -> YieldFuture<'_> ⓘ
Yield the execution of the recursive futures back to the reblessive runtime.
When stepping through a function instead of finishing it awaiting the future returned by this function will cause the the current step to complete.