Skip to main content

Pointer

Trait Pointer 

Source
pub trait Pointer<T: ?Sized>:
    Primitive
    + Copy
    + Debug
    + Sized {
    // Required methods
    fn ptr_type() -> Mutability;
    fn cast_ptr<U: Sized, P: Pointer<U>>(self) -> P
       where Self: Sized;
    fn cast_int<I: Integer>(self) -> I
       where T: Sized;
}

Required Methods§

Source

fn ptr_type() -> Mutability

Source

fn cast_ptr<U: Sized, P: Pointer<U>>(self) -> P
where Self: Sized,

Source

fn cast_int<I: Integer>(self) -> I
where T: Sized,

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<T: ?Sized> Pointer<T> for *const T

Source§

fn ptr_type() -> Mutability

Source§

fn cast_ptr<U: Sized, P: Pointer<U>>(self) -> P
where Self: Sized,

Source§

fn cast_int<I: Integer>(self) -> I
where T: Sized,

Source§

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

Source§

fn ptr_type() -> Mutability

Source§

fn cast_ptr<U: Sized, P: Pointer<U>>(self) -> P
where Self: Sized,

Source§

fn cast_int<I: Integer>(self) -> I
where T: Sized,

Implementors§