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

source

pub fn run<'a, F, Fut, R>(&'a mut self, f: F) -> StkFuture<'a, F, R>
where F: FnOnce(&'a mut Stk) -> Fut, Fut: Future<Output = R> + 'a,

Run a new future in the runtime.

source

pub fn enter_run<'a, F, Fut, R>(f: F) -> StkFuture<'a, F, R>
where F: FnOnce(&'a mut Stk) -> Fut, Fut: Future<Output = R> + 'a,

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

source

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.

Auto Trait Implementations§

§

impl Freeze for Stk

§

impl !RefUnwindSafe for Stk

§

impl !Send for Stk

§

impl !Sync for Stk

§

impl Unpin for Stk

§

impl !UnwindSafe for Stk

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

§

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

§

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.