Trait rustc_ap_rustc_data_structures::owning_ref::ToHandle[][src]

pub trait ToHandle {
    type Handle: Deref;
    unsafe fn to_handle(x: *const Self) -> Self::Handle;
}
Expand description

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

Associated Types

type Handle: Deref[src]

The type of handle to be encapsulated by the OwningHandle.

Required methods

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

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

Implementations on Foreign Types

impl<T: 'static> ToHandle for RefCell<T>[src]

type Handle = Ref<'static, T>

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

Implementors