Skip to main content

RawPtr

Trait RawPtr 

Source
pub trait RawPtr:
    Ptr
    + Sized
    + Copy {
    // Provided methods
    fn cast<U>(self) -> *const U { ... }
    fn cast_mut(self) -> *mut Self::Target { ... }
}
Expand description

Marker trait identifying raw pointers.

Provided Methods§

Source

fn cast<U>(self) -> *const U

Source

fn cast_mut(self) -> *mut Self::Target

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.

Implementations on Foreign Types§

Source§

impl<T: ?Sized> RawPtr for *const T

Source§

impl<T: ?Sized> RawPtr for *mut T

Source§

impl<T: ?Sized> RawPtr for NonNull<T>

Source§

impl<T: ?Sized> RawPtr for NonNullConst<T>

Available on crate feature non_null_const only.

Implementors§