FutureOps

Trait FutureOps 

Source
pub trait FutureOps {
    type Payload;

    // Required methods
    fn new(&mut self) -> u64;
    fn elem_layout(&mut self) -> Layout;
    unsafe fn lower(&mut self, payload: Self::Payload, dst: *mut u8);
    unsafe fn dealloc_lists(&mut self, dst: *mut u8);
    unsafe fn lift(&mut self, dst: *mut u8) -> Self::Payload;
    unsafe fn start_write(&mut self, future: u32, val: *const u8) -> u32;
    unsafe fn start_read(&mut self, future: u32, val: *mut u8) -> u32;
    unsafe fn cancel_read(&mut self, future: u32) -> u32;
    unsafe fn cancel_write(&mut self, future: u32) -> u32;
    unsafe fn drop_readable(&mut self, future: u32);
    unsafe fn drop_writable(&mut self, future: u32);
}
Available on crate feature async only.
Expand description

Helper trait which encapsulates the various operations which can happen with a future.

Required Associated Types§

Source

type Payload

The Rust type that’s sent or received on this future.

Required Methods§

Source

fn new(&mut self) -> u64

The future.new intrinsic.

Source

fn elem_layout(&mut self) -> Layout

The canonical ABI layout of the type that this future is sending/receiving.

Source

unsafe fn lower(&mut self, payload: Self::Payload, dst: *mut u8)

Converts a Rust type to its canonical ABI representation.

Source

unsafe fn dealloc_lists(&mut self, dst: *mut u8)

Used to deallocate any Rust-owned lists in the canonical ABI representation for when a value is successfully sent but needs to be cleaned up.

Source

unsafe fn lift(&mut self, dst: *mut u8) -> Self::Payload

Converts from the canonical ABI representation to a Rust value.

Source

unsafe fn start_write(&mut self, future: u32, val: *const u8) -> u32

The future.write intrinsic

Source

unsafe fn start_read(&mut self, future: u32, val: *mut u8) -> u32

The future.read intrinsic

Source

unsafe fn cancel_read(&mut self, future: u32) -> u32

The future.cancel-read intrinsic

Source

unsafe fn cancel_write(&mut self, future: u32) -> u32

The future.cancel-write intrinsic

Source

unsafe fn drop_readable(&mut self, future: u32)

The future.drop-readable intrinsic

Source

unsafe fn drop_writable(&mut self, future: u32)

The future.drop-writable intrinsic

Implementors§