Skip to main content

CreateHandle

Trait CreateHandle 

Source
pub unsafe trait CreateHandle<ProxyTiming: Timing>: PlaceProxy {
    type Handle: PlaceHandle<Target = Self::Target>;

    const ACCESS: AccessKind;

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

TODO: Defines creation of handles.

A handle to the represented place can be obtained from a value of this type by calling Self::handle_from_raw.

The timing of the access permissions of Self::handle_from_raw is ProxyTiming.

The Self::ACCESS constant specifies what type of permission is required for creating a handle this way. The ProxyTiming argument specifies for how long that permission must be granted; it must be one of the types in the borrowck module. Any compiler-generated handle creations automatically honor these requirements via the borrow checker.

Required Associated Constants§

Source

const ACCESS: AccessKind

The access permissions required by Self::handle_from_raw.

Required Associated Types§

Source

type Handle: PlaceHandle<Target = Self::Target>

The handle that’s used for operating on the represented place.

This type controls which place operations are available on the represented place. For example, if this implements ReadPlace, then writing *self is allowed and yields a value of type Self::Handle::Target (where self: Self).

Required Methods§

Source

unsafe fn handle_from_raw(this: *const Self) -> Self::Handle

Create a handle to the pointee of the raw pointer.

§Safety
  • this must be a valid pointer for as long as the return value lives,
  • *this must be handle-valid with permissions Self::ACCESS for ProxyTiming.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a, T: ?Sized> CreateHandle<Instant> for &'a T

Source§

const ACCESS: AccessKind = AccessKind::Shared

Source§

type Handle = RefHandle<'a, T>

Source§

unsafe fn handle_from_raw(this: *const Self) -> Self::Handle

Source§

impl<'a, T: ?Sized> CreateHandle<Instant> for &'a mut T

Source§

const ACCESS: AccessKind = AccessKind::Shared

Source§

type Handle = MutHandle<'a, T>

Source§

unsafe fn handle_from_raw(this: *const Self) -> Self::Handle

Source§

impl<'b, T> CreateHandle<Instant> for RefMut<'b, T>

Source§

const ACCESS: AccessKind = AccessKind::Shared

Source§

type Handle = CellMutHandle<'b, T>

Source§

unsafe fn handle_from_raw(_this: *const Self) -> Self::Handle

Source§

impl<ProxyTiming, P> CreateHandle<ProxyTiming> for Pin<P>
where ProxyTiming: Timing, P: CreateHandle<ProxyTiming>,

Source§

const ACCESS: AccessKind = P::ACCESS

Source§

type Handle = PinnedHandle<<P as CreateHandle<ProxyTiming>>::Handle>

Source§

unsafe fn handle_from_raw(this: *const Self) -> Self::Handle

Source§

impl<T: ?Sized> CreateHandle<Instant> for *const T

Source§

const ACCESS: AccessKind = AccessKind::Untracked

Source§

type Handle = *const T

Source§

unsafe fn handle_from_raw(this: *const Self) -> Self::Handle

Source§

impl<T: ?Sized> CreateHandle<Instant> for *mut T

Source§

const ACCESS: AccessKind = AccessKind::Untracked

Source§

type Handle = *mut T

Source§

unsafe fn handle_from_raw(this: *const Self) -> Self::Handle

Source§

impl<T: ?Sized> CreateHandle<Instant> for Arc<T>

Source§

const ACCESS: AccessKind = AccessKind::Shared

Source§

type Handle = ArcHandle<T>

Source§

unsafe fn handle_from_raw(this: *const Self) -> Self::Handle

Source§

impl<T: ?Sized> CreateHandle<Instant> for Box<T>

Source§

const ACCESS: AccessKind = AccessKind::Shared

Source§

type Handle = BoxHandle<T>

Source§

unsafe fn handle_from_raw(this: *const Self) -> Self::Handle

Source§

impl<T: ?Sized> CreateHandle<Instant> for NonNull<T>

Source§

const ACCESS: AccessKind = AccessKind::Untracked

Source§

type Handle = NonNull<T>

Source§

unsafe fn handle_from_raw(this: *const Self) -> Self::Handle

Source§

impl<T> CreateHandle<Instant> for Vec<T>

Source§

const ACCESS: AccessKind = AccessKind::Shared

Source§

type Handle = VecHandle<T>

Source§

unsafe fn handle_from_raw(this: *const Self) -> Self::Handle

Implementors§

Source§

impl<T: ?Sized> CreateHandle<Instant> for ArcRef<T>

Source§

const ACCESS: AccessKind = AccessKind::Shared

Source§

type Handle = ArcRefHandle<T>