Trait owning_ref::ToHandle

source ·
pub trait ToHandle {
    type Handle: Deref;

    // Required method
    unsafe fn to_handle(x: *const Self) -> Self::Handle;
}
Expand description

Trait to implement the conversion of owner to handle for common types.

Required Associated Types§

source

type Handle: Deref

The type of handle to be encapsulated by the OwningHandle.

Required Methods§

source

unsafe fn to_handle(x: *const Self) -> Self::Handle

Given an appropriately-long-lived pointer to ourselves, create a handle to be encapsulated by the OwningHandle.

Implementations on Foreign Types§

source§

impl<T: 'static> ToHandle for RefCell<T>

§

type Handle = Ref<'static, T>

source§

unsafe fn to_handle(x: *const Self) -> Self::Handle

Implementors§