use core::ptr;
use crate::traits::{FastZeroizable, ZeroizationProbe, ZeroizeMetadata};
impl<T> ZeroizationProbe for *mut T {
#[inline(always)]
fn is_zeroized(&self) -> bool {
self.is_null()
}
}
impl<T> ZeroizeMetadata for *mut T {
const CAN_BE_BULK_ZEROIZED: bool = false;
}
impl<T> FastZeroizable for *mut T {
#[inline(always)]
fn fast_zeroize(&mut self) {
unsafe {
ptr::write_volatile(self, ptr::null_mut());
}
}
}
impl<T> ZeroizationProbe for *const T {
#[inline(always)]
fn is_zeroized(&self) -> bool {
self.is_null()
}
}
impl<T> ZeroizeMetadata for *const T {
const CAN_BE_BULK_ZEROIZED: bool = false;
}
impl<T> FastZeroizable for *const T {
#[inline(always)]
fn fast_zeroize(&mut self) {
unsafe {
ptr::write_volatile(self, ptr::null());
}
}
}