Struct ResumeTy

Source
#[doc(hidden)] pub struct ResumeTy(NonNull<Context<'static>>);
🔬This is a nightly-only experimental API. (gen_future)
Expand description

This type is needed because:

a) Coroutines cannot implement for<'a, 'b> Coroutine<&'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)

Trait Implementations§

Source§

impl Clone for ResumeTy

Source§

fn clone(&self) -> ResumeTy

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ResumeTy

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for ResumeTy

Source§

impl Send for ResumeTy

Source§

impl Sync for ResumeTy