Cast

Trait Cast 

Source
pub unsafe trait Cast<Src: ?Sized, Dst: ?Sized>: Project<Src, Dst> { }
Expand description

A Project which preserves the address of the referent – a pointer cast.

§Safety

A Cast projection must preserve the address of the referent. It may shrink the set of referent bytes, and it may change the referent’s type.

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<Src, Dst> Cast<Src, Dst> for CastSized

Source§

impl<Src, Dst> Cast<Src, Dst> for CastUnsized
where Src: ?Sized + KnownLayout, Dst: ?Sized + KnownLayout<PointerMetadata = Src::PointerMetadata>,

Source§

impl<T, U, V, TU, UV> Cast<T, V> for TransitiveProject<U, TU, UV>
where T: ?Sized, U: ?Sized, V: ?Sized, TU: Cast<T, U>, UV: Cast<U, V>,

Source§

impl<T: ?Sized> Cast<T, T> for IdCast