pub struct Handle(/* private fields */);
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.
Implementations§
Trait Implementations§
source§impl FfiDefault for Handle
impl FfiDefault for Handle
fn ffi_default() -> Handle
source§impl PartialEq for Handle
impl PartialEq for Handle
impl Copy for Handle
impl Eq for Handle
impl StructuralPartialEq for Handle
Auto Trait Implementations§
impl Freeze for Handle
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
source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<>