pub trait DataPtr {
    // Required method
    fn data_ptr(this: &Self) -> *const ();

    // Provided method
    fn data_ptr_eq(this: &Self, other: &Self) -> bool { ... }
}
Expand description

An extension trait for smart pointers. Provides an interface to get a raw pointer to the data (with metadata stripped away).

This is useful to see if two smart pointers point to the same allocation.

Required Methods§

source

fn data_ptr(this: &Self) -> *const ()

Returns a raw pointer to the data, stripping away all metadata.

Provided Methods§

source

fn data_ptr_eq(this: &Self, other: &Self) -> bool

Check if two pointers point to the same data.

Implementations on Foreign Types§

source§

impl<T: ?Sized> DataPtr for Arc<T>

Implementors§