pub unsafe trait IndexPlace<Idx, H, PointeeTiming, PointerTiming>: Indexable<Idx>{
type ElementHandle: PlaceHandle<Target = Self::Element>;
const POINTEE_ACCESS: AccessKind;
const POINTER_ACCESS: AccessKind;
const SAFE: bool;
// Required method
fn index(handle: H, idx: Idx) -> Self::ElementHandle;
}Expand description
place[idx] – Index into Self via the handle H.
The same way that Indexable is the generic version of PlaceProxy,
this trait is the generic version of DerefPlace.
Indexing – like dereferencing – also performs two accesses from the borrow-checker’s perspective:
- the place that comes out of the index operation (
place[idx]), and - the place that is being indexed into (
place).
For this reason, there are two AccessKind constants and two Timing
generics, see the documentation of DerefPlace for more information about
them.
Required Associated Constants§
Sourceconst POINTEE_ACCESS: AccessKind
const POINTEE_ACCESS: AccessKind
The access permissions to the contents of the place handled by Self
required by Self::index.
Sourceconst POINTER_ACCESS: AccessKind
const POINTER_ACCESS: AccessKind
The access permissions to the place handled by Self required by
Self::index.
Sourceconst SAFE: bool
const SAFE: bool
Whether Self::index is safe when Self::POINTEE_ACCESS and
Self::POINTER_ACCESS are honored for PointeeTiming and
PointerTiming respectively.
This constant controls whether the compiler will require writing an
unsafe block around indexing into a place that uses the H handle.
Required Associated Types§
Sourcetype ElementHandle: PlaceHandle<Target = Self::Element>
type ElementHandle: PlaceHandle<Target = Self::Element>
The type of handles to indexed elements.
Required Methods§
Sourcefn index(handle: H, idx: Idx) -> Self::ElementHandle
fn index(handle: H, idx: Idx) -> Self::ElementHandle
Indexes into the value stored at H.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".