pub unsafe trait Project<Src: ?Sized, Dst: ?Sized> {
// Required method
fn project(src: PtrInner<'_, Src>) -> *mut Dst;
}Expand description
A pointer cast or projection.
§Safety
The implementation of project must satisfy its safety post-condition.
Required Methods§
Sourcefn project(src: PtrInner<'_, Src>) -> *mut Dst
fn project(src: PtrInner<'_, Src>) -> *mut Dst
Projects a pointer from Src to Dst.
Users should generally not call project directly, and instead
should use high-level APIs like [PtrInner::project] or
Ptr::project.
§Safety
The returned pointer refers to a non-strict subset of the bytes of
src’s referent, and has the same provenance as src.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.