pub fn can_write<T: ?Sized>(ptr: *mut T) -> bool
Expand description
Check if the pointer is valid for write access according to crate::mem conditions 1, 2 and 3.
Note this function also checks for pointer alignment. Use self::can_write_unaligned if you don’t want to fail for unaligned pointers.
This function does not check if the value stored is valid for the given type. Use self::can_dereference for that.
This function will panic today if the pointer is not null, and it points to an unallocated or deallocated memory location. This is an existing Kani limitation. See https://github.com/model-checking/kani/issues/2690 for more details.