Skip to main content

SizeEq

Trait SizeEq 

Source
pub trait SizeEq<Src: ?Sized> {
    type CastFrom: CastExact<Src, Self>;
}
Expand description

Carries the ability to perform a size-preserving cast or conversion from a raw pointer to Src to a raw pointer to Self.

The cast/conversion is carried by the associated CastFrom type, and may be a no-op cast (without updating pointer metadata) or a conversion which updates pointer metadata.

§Safety

SizeEq on its own conveys no safety guarantee. Any safety guarantees come from the safety invariants on the associated CastFrom type, specifically the CastExact bound.

Required Associated Types§

Source

type CastFrom: CastExact<Src, Self>

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.

Implementors§

Source§

impl<T> SizeEq<Cell<T>> for UnsafeCell<T>
where T: SizeEq<Cell<T>> + ?Sized, UnsafeCell<T>: SizeEq<T>,

Source§

impl<T> SizeEq<UnsafeCell<T>> for Cell<T>
where T: SizeEq<UnsafeCell<T>> + ?Sized, Cell<T>: SizeEq<T>,

Source§

impl<T> SizeEq<Wrapping<T>> for MaybeUninit<T>
where T: SizeEq<Wrapping<T>>, MaybeUninit<T>: SizeEq<T>,

Source§

impl<T> SizeEq<Wrapping<T>> for T

Source§

type CastFrom = CastFromWrapper

Source§

impl<T> SizeEq<MaybeUninit<T>> for Wrapping<T>
where T: SizeEq<MaybeUninit<T>>, Wrapping<T>: SizeEq<T>,

Source§

impl<T> SizeEq<MaybeUninit<T>> for T

Source§

impl<T> SizeEq<T> for Wrapping<T>

Source§

type CastFrom = CastToWrapper

Source§

impl<T> SizeEq<T> for MaybeUninit<T>

Source§

impl<T: ?Sized> SizeEq<Cell<T>> for T

Source§

type CastFrom = CastFromWrapper

Source§

impl<T: ?Sized> SizeEq<UnsafeCell<T>> for T

Source§

type CastFrom = CastFromWrapper

Source§

impl<T: ?Sized> SizeEq<ManuallyDrop<T>> for T

Source§

type CastFrom = CastFromWrapper

Source§

impl<T: ?Sized> SizeEq<T> for Cell<T>

Source§

type CastFrom = CastToWrapper

Source§

impl<T: ?Sized> SizeEq<T> for UnsafeCell<T>

Source§

type CastFrom = CastToWrapper

Source§

impl<T: ?Sized> SizeEq<T> for ManuallyDrop<T>

Source§

type CastFrom = CastToWrapper

Source§

impl<T: ?Sized> SizeEq<T> for T