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§
Sourceunsafe fn drop(self, ptr: NonNull<u8>)
unsafe fn drop(self, ptr: NonNull<u8>)
Deallocates memory at ptr and drops self.
§Safety
ptrmust have been obtained via [NewOwned] with the same value ofself.- This method may only be called once for such a pointer.
- After calling this method, the memory behind
ptrmay 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.