Skip to main content

ReprOwned

Trait ReprOwned 

Source
pub unsafe trait ReprOwned: ReprMut {
    // Required method
    unsafe fn drop(self, ptr: NonNull<u8>);
}
Expand description

Extension trait for Repr that supports deallocation of owned matrices. This is used in conjunction with NewOwned to create matrices.

Requires ReprMut since owned matrices should support mutation.

§Safety

Implementors must ensure that drop properly deallocates the memory in a way compatible with all NewOwned implementations.

Required Methods§

Source

unsafe fn drop(self, ptr: NonNull<u8>)

Deallocates memory at ptr and drops self.

§Safety
  • ptr must have been obtained via NewOwned with the same value of self.
  • This method may only be called once for such a pointer.
  • After calling this method, the memory behind ptr may not be dereferenced at all.

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: Copy> ReprOwned for Standard<T>

Source§

impl<const NBITS: usize> ReprOwned for MinMaxMeta<NBITS>
where Unsigned: Representation<NBITS>,