#[repr(transparent)]pub struct Handle(u64);
Expand description
Object handle
Handles opaque u64
values used to pass objects across the FFI, both for objects implemented in
Rust and ones implemented in the foreign language.
Rust handles are generated by leaking a raw pointer Foreign handles are generated with a handle map that only generates odd values. For all currently supported architectures and hopefully any ones we add in the future:
- 0 is an invalid value.
- The lowest bit will always be set for foreign handles and never set for Rust ones (since the leaked pointer will be aligned).
Rust handles are mainly managed is through the crate::HandleAlloc trait.
Tuple Fields§
§0: u64
Implementations§
Trait Implementations§
§impl FfiDefault for Handle
impl FfiDefault for Handle
fn ffi_default() -> Handle
impl Copy for Handle
impl Eq for Handle
impl StructuralEq for Handle
impl StructuralPartialEq for Handle
Auto Trait Implementations§
impl RefUnwindSafe for Handle
impl Send for Handle
impl Sync for Handle
impl Unpin for Handle
impl UnwindSafe for Handle
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T, UT> HandleAlloc<UT> for Twhere
T: Send + Sync,
impl<T, UT> HandleAlloc<UT> for Twhere T: Send + Sync,
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§fn clone_handle(handle: Handle) -> Handle
fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<>