Skip to main content

MutationCompatible

Trait MutationCompatible 

Source
pub unsafe trait MutationCompatible<Src: ?Sized, A: Aliasing, SV, DV, R> { }
Expand description

Denotes that src: Ptr<Src, (A, _, SV)> and dst: Ptr<Self, (A, _, DV)>, referencing the same referent at the same time, cannot be used by safe code to break library safety invariants of Src or Self.

§Safety

At least one of the following must hold:

  • Src: Read<A, _> and Self: Read<A, _>
  • Self: InvariantsEq<Src>, and, for some V:
    • Dst: TransmuteFrom<Src, V, V>
    • Src: TransmuteFrom<Dst, V, V>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<Src, Dst, A: Aliasing, SV: Validity, DV: Validity, R> MutationCompatible<Src, A, SV, DV, (BecauseRead, R)> for Dst
where Src: Read<A, R> + ?Sized, Dst: Read<A, R> + ?Sized,

Source§

impl<Src, Dst, A: Aliasing, SV: Validity, DV: Validity> MutationCompatible<Src, A, SV, DV, BecauseInvariantsEq> for Dst
where Src: TransmuteFrom<Dst, DV, SV> + ?Sized, Dst: TransmuteFrom<Src, SV, DV> + InvariantsEq<Src> + ?Sized,