pub unsafe trait BorrowPlace<Output>: PlaceHandle {
type Timing: Timing;
const ACCESS: AccessKind;
const SAFE: bool;
// Required method
unsafe fn borrow(self) -> Output;
}Expand description
&place/@place – Borrow a place as Output.
Borrowing a place creates a pointer to the place. This operation is generic over the resulting pointer type and borrowing the same place with many different pointer types is supported.
There are a few ways to spell borrowing a place:
&placeand&mut place— resulting inOutput = &_andOutput = &mut _respectively,&raw const placeand&raw mut place—Output = *const _andOutput = *mut _@placeand@<$ty> place—Output = _andOutput = $ty
All of these are desugared to
BorrowPlace::<Output>::borrow(handle!($place)). Where handle! is
explained in the section on place
expressions
Required Associated Constants§
Sourceconst ACCESS: AccessKind
const ACCESS: AccessKind
The access permissions to the place required by Self::borrow.
Sourceconst SAFE: bool
const SAFE: bool
Whether Self::borrow is safe when Self::ACCESS is honored for
Self::Timing.
This constant controls whether the compiler will require writing an
unsafe block around borrowing a place that uses this handle.
Required Associated Types§
Sourcetype Timing: Timing
type Timing: Timing
The timing of the access permissions of Self::borrow.
Required Methods§
Sourceunsafe fn borrow(self) -> Output
unsafe fn borrow(self) -> Output
Borrow the place using Output.
§Safety
This handle must have Self::ACCESS permissions for the duration of
Self::Timing.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".