pub struct CacheFlushOnDrop<T: CacheFlushSanitize> { /* private fields */ }Expand description
Clear-on-drop wrapper using volatile writes followed by x86_64 cache line eviction.
Implementations§
Source§impl<T: CacheFlushSanitize> CacheFlushOnDrop<T>
impl<T: CacheFlushSanitize> CacheFlushOnDrop<T>
Sourcepub const fn new(inner: T) -> Self
pub const fn new(inner: T) -> Self
Wrap a value that implements CacheFlushSanitize.
Sourcepub fn with_secret<R>(&self, inspect: impl FnOnce(&T) -> R) -> R
pub fn with_secret<R>(&self, inspect: impl FnOnce(&T) -> R) -> R
Run a closure with read-only access to the wrapped value.
Sourcepub fn with_secret_mut<R>(&mut self, edit: impl FnOnce(&mut T) -> R) -> R
pub fn with_secret_mut<R>(&mut self, edit: impl FnOnce(&mut T) -> R) -> R
Run a closure with mutable access to the wrapped value.
Sourcepub fn into_cleared(self)
pub fn into_cleared(self)
Consume the wrapper after first clearing and flushing the wrapped value.
Trait Implementations§
Source§impl<T: CacheFlushSanitize> Debug for CacheFlushOnDrop<T>
impl<T: CacheFlushSanitize> Debug for CacheFlushOnDrop<T>
Source§impl<T: CacheFlushSanitize> Drop for CacheFlushOnDrop<T>
impl<T: CacheFlushSanitize> Drop for CacheFlushOnDrop<T>
Auto Trait Implementations§
impl<T> Freeze for CacheFlushOnDrop<T>where
T: Freeze,
impl<T> RefUnwindSafe for CacheFlushOnDrop<T>where
T: RefUnwindSafe,
impl<T> Send for CacheFlushOnDrop<T>where
T: Send,
impl<T> Sync for CacheFlushOnDrop<T>where
T: Sync,
impl<T> Unpin for CacheFlushOnDrop<T>where
T: Unpin,
impl<T> UnsafeUnpin for CacheFlushOnDrop<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for CacheFlushOnDrop<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more