Type Alias dryoc::protected::ptypes::Unlocked

source ·
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<T: Zeroize + Bytes + Clone> Clone for Unlocked<T>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<A: Zeroize + MutBytes + AsMut<[u8]>, LM: LockMode> AsMut<[u8]> for Protected<A, ReadWrite, LM>

source§

fn as_mut(&mut self) -> &mut [u8]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<const LENGTH: usize> AsMut<[u8; LENGTH]> for Protected<HeapByteArray<LENGTH>, ReadWrite, Unlocked>

source§

fn as_mut(&mut self) -> &mut [u8; LENGTH]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<A: Zeroize + Bytes + AsRef<[u8]>, LM: LockMode> AsRef<[u8]> for Protected<A, ReadWrite, LM>

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<const LENGTH: usize> ByteArray<LENGTH> for Protected<HeapByteArray<LENGTH>, ReadWrite, Unlocked>

source§

fn as_array(&self) -> &[u8; LENGTH]

Returns a reference to the underlying fixed-length byte array.
source§

impl<A: Zeroize + Bytes, LM: LockMode> Bytes for Protected<A, ReadWrite, LM>

source§

fn as_slice(&self) -> &[u8]

Returns a slice of the underlying bytes.
source§

fn len(&self) -> usize

Shorthand to retrieve the underlying length of the byte array.
source§

fn is_empty(&self) -> bool

Returns true if the array is empty.
source§

impl<A: MutBytes + Zeroize, LM: LockMode> DerefMut for Protected<A, ReadWrite, LM>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<A: Zeroize + Bytes, PM: ProtectMode, LM: LockMode> Drop for Protected<A, PM, LM>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

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>

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>

source§

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>

source§

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])

Copies into the underlying slice from other. Panics if lengths do not match.
source§

impl<A: Zeroize + Bytes, PM: ProtectMode> ProtectNoAccess<A, PM> for Protected<A, PM, Unlocked>

source§

fn mprotect_noaccess(self) -> Result<Protected<A, NoAccess, Unlocked>, Error>

Protects an unlocked region of memory as no-access (and no exec), using mprotect() on UNIX, or VirtualProtect() on Windows.
source§

impl<A: Zeroize + Bytes, PM: ProtectMode, LM: LockMode> ProtectReadOnly<A, PM, LM> for Protected<A, PM, LM>

source§

fn mprotect_readonly(self) -> Result<Protected<A, ReadOnly, LM>, Error>

Protects a region of memory as read-only (and no exec), using mprotect() on UNIX, or VirtualProtect() on Windows.
source§

impl<A: Zeroize + Bytes, PM: ProtectMode, LM: LockMode> ProtectReadWrite<A, PM, LM> for Protected<A, PM, LM>

source§

fn mprotect_readwrite(self) -> Result<Protected<A, ReadWrite, LM>, Error>

Protects a region of memory as read-write (and no exec), using mprotect() on UNIX, or VirtualProtect() on Windows.
source§

impl<A: Zeroize + NewBytes + ResizableBytes + Lockable<A>> ResizableBytes for Protected<A, ReadWrite, Unlocked>

source§

fn resize(&mut self, new_len: usize, value: u8)

Resizes self with new_len elements, populating new values with value.
source§

impl<A: Zeroize + Bytes, PM: ProtectMode, LM: LockMode> Unlock<A, PM> for Protected<A, PM, LM>

source§

fn munlock(self) -> Result<Protected<A, PM, Unlocked>, Error>

Unlocks a region of memory, using munlock() on UNIX, or VirtualLock() on Windows.
source§

impl<A: Zeroize + Bytes, PM: ProtectMode, LM: LockMode> Zeroize for Protected<A, PM, LM>

source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.
source§

impl<A: Bytes + Zeroize, LM: LockMode> Deref for Protected<A, ReadWrite, LM>

§

type Target = [u8]

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.