oa::SecureBuffer

A non-owning mutable byte range that is securely erased when reset or dropped. Linux page locking is best effort and observable through Self::is_locked. The borrow guarantees that the backing range remains alive for this guard.

StRust public API

Declaration

pub struct SecureBuffer<'a> { /* private fields */ }
Public Rust declaration.

Public Methods

pub fn as_slice(&self) -> &[u8] ⓘ
pub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
pub fn size_bytes(&self) -> usize
pub fn is_valid(&self) -> bool
pub const fn is_locked(&self) -> bool
pub fn secure_zero(&mut self)
pub fn reset(&mut self)
fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
fn drop(&mut self)

Associated Functions

pub fn new(bytes: &'a mut [u8]) -> Self

Public Method Documentation

pub fn as_slice( &self ) -> &[u8] ⓘ
No public source comment is attached to this declaration.
pub fn as_mut_slice( &mut self ) -> &mut [u8] ⓘ
No public source comment is attached to this declaration.
pub fn size_bytes( &self ) -> usize
No public source comment is attached to this declaration.
pub fn is_valid( &self ) -> bool
No public source comment is attached to this declaration.
pub const fn is_locked( &self ) -> bool
No public source comment is attached to this declaration.
pub fn secure_zero( &mut self )
No public source comment is attached to this declaration.
pub fn reset( &mut self )
No public source comment is attached to this declaration.
fn fmt( &self, formatter: &mut Formatter<'_> ) -> Result
No public source comment is attached to this declaration.
fn drop( &mut self )
No public source comment is attached to this declaration.
pub fn new( bytes: &'a mut [u8] ) -> Self
No public source comment is attached to this declaration.