Struct std::future::ResumeTy

source ·
pub struct ResumeTy(NonNull<Context<'static>>);
🔬This is a nightly-only experimental API. (gen_future #50547)
Expand description

This type is needed because:

a) Generators cannot implement for<'a, 'b> Generator<&'a mut Context<'b>>, so we need to pass a raw pointer (see https://github.com/rust-lang/rust/issues/68923). b) Raw pointers and NonNull aren’t Send or Sync, so that would make every single future non-Send/Sync as well, and we don’t want that.

It also simplifies the HIR lowering of .await.

Tuple Fields§

§0: NonNull<Context<'static>>
🔬This is a nightly-only experimental API. (gen_future #50547)