pub type Unlocked<T> = Protected<T, ReadWrite, Unlocked>;
Available on crate feature
nightly
only.Expand description
Unlocked, read-write, page-aligned memory region type alias
Aliased Type§
struct Unlocked<T> { /* private fields */ }
Trait Implementations§
source§impl<A: Zeroize + MutBytes + AsMut<[u8]>, LM: LockMode> AsMut<[u8]> for Protected<A, ReadWrite, LM>
impl<A: Zeroize + MutBytes + AsMut<[u8]>, LM: LockMode> AsMut<[u8]> for Protected<A, ReadWrite, LM>
source§impl<const LENGTH: usize> AsMut<[u8; LENGTH]> for Protected<HeapByteArray<LENGTH>, ReadWrite, Unlocked>
impl<const LENGTH: usize> AsMut<[u8; LENGTH]> for Protected<HeapByteArray<LENGTH>, ReadWrite, Unlocked>
source§impl<A: Zeroize + Bytes + AsRef<[u8]>, LM: LockMode> AsRef<[u8]> for Protected<A, ReadWrite, LM>
impl<A: Zeroize + Bytes + AsRef<[u8]>, LM: LockMode> AsRef<[u8]> for Protected<A, ReadWrite, LM>
source§impl<const LENGTH: usize> ByteArray<LENGTH> for Protected<HeapByteArray<LENGTH>, ReadWrite, Unlocked>
impl<const LENGTH: usize> ByteArray<LENGTH> for Protected<HeapByteArray<LENGTH>, ReadWrite, Unlocked>
source§impl<A: Zeroize + Bytes + Default, PM: ProtectMode> Lock<A, PM> for Protected<A, PM, Unlocked>
impl<A: Zeroize + Bytes + Default, PM: ProtectMode> Lock<A, PM> for Protected<A, PM, Unlocked>
source§fn mlock(self) -> Result<Protected<A, PM, Locked>, Error>
fn mlock(self) -> Result<Protected<A, PM, Locked>, Error>
Locks a region of memory, using
mlock()
on UNIX, or VirtualLock()
on
Windows. By default, the protect mode is set to ReadWrite (i.e., no
exec) using mprotect()
on UNIX, or VirtualProtect()
on Windows.
On Linux, it will also set MADV_DONTDUMP
using madvise()
.source§impl<const LENGTH: usize> MutByteArray<LENGTH> for Protected<HeapByteArray<LENGTH>, ReadWrite, Unlocked>
impl<const LENGTH: usize> MutByteArray<LENGTH> for Protected<HeapByteArray<LENGTH>, ReadWrite, Unlocked>
source§fn as_mut_array(&mut self) -> &mut [u8; LENGTH]
fn as_mut_array(&mut self) -> &mut [u8; LENGTH]
Returns a mutable reference to the underlying fixed-length byte array.
source§impl<A: Zeroize + MutBytes, LM: LockMode> MutBytes for Protected<A, ReadWrite, LM>
impl<A: Zeroize + MutBytes, LM: LockMode> MutBytes for Protected<A, ReadWrite, LM>
source§fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
Returns a mutable slice to the underlying bytes.
source§fn copy_from_slice(&mut self, other: &[u8])
fn copy_from_slice(&mut self, other: &[u8])
Copies into the underlying slice from
other
. Panics if lengths do not
match.