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§
Required Methods§
Sourcefn elem_layout(&mut self) -> Layout
fn elem_layout(&mut self) -> Layout
The canonical ABI layout of the type that this future is sending/receiving.
Sourceunsafe fn lower(&mut self, payload: Self::Payload, dst: *mut u8)
unsafe fn lower(&mut self, payload: Self::Payload, dst: *mut u8)
Converts a Rust type to its canonical ABI representation.
Sourceunsafe fn dealloc_lists(&mut self, dst: *mut u8)
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.
Sourceunsafe fn lift(&mut self, dst: *mut u8) -> Self::Payload
unsafe fn lift(&mut self, dst: *mut u8) -> Self::Payload
Converts from the canonical ABI representation to a Rust value.
Sourceunsafe fn start_write(&mut self, future: u32, val: *const u8) -> u32
unsafe fn start_write(&mut self, future: u32, val: *const u8) -> u32
The future.write intrinsic
Sourceunsafe fn cancel_read(&mut self, future: u32) -> u32
unsafe fn cancel_read(&mut self, future: u32) -> u32
The future.cancel-read intrinsic
Sourceunsafe fn cancel_write(&mut self, future: u32) -> u32
unsafe fn cancel_write(&mut self, future: u32) -> u32
The future.cancel-write intrinsic
Sourceunsafe fn drop_readable(&mut self, future: u32)
unsafe fn drop_readable(&mut self, future: u32)
The future.drop-readable intrinsic
Sourceunsafe fn drop_writable(&mut self, future: u32)
unsafe fn drop_writable(&mut self, future: u32)
The future.drop-writable intrinsic