Type Alias dryoc::protected::ptypes::Locked

source ·
pub type Locked<T> = Protected<T, ReadWrite, Locked>;
Available on crate feature nightly only.
Expand description

Locked, read-write, page-aligned memory region type alias

Aliased Type§

struct Locked<T> { /* private fields */ }

Trait Implementations§

source§

impl<T: Zeroize + NewBytes + ResizableBytes + Lockable<T> + NewLocked<T>> Clone for Locked<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<'de, const LENGTH: usize> Deserialize<'de> for Locked<HeapByteArray<LENGTH>>

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<const LENGTH: usize> Serialize for Locked<HeapByteArray<LENGTH>>

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. 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, Locked>

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, Locked>

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: Zeroize + NewBytes + Lockable<A> + NewLocked<A>> Default for Protected<A, ReadWrite, Locked>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
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<const LENGTH: usize> MutByteArray<LENGTH> for Protected<HeapByteArray<LENGTH>, ReadWrite, Locked>

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<const LENGTH: usize> NewByteArray<LENGTH> for Protected<HeapByteArray<LENGTH>, ReadWrite, Locked>

source§

fn new_byte_array() -> Self

Returns a new fixed-length byte array, initialized with zeroes.
source§

fn gen() -> Self

Returns a new fixed-length byte array, filled with random values.
source§

impl<const LENGTH: usize> NewBytes for Protected<HeapByteArray<LENGTH>, ReadWrite, Locked>

source§

fn new_bytes() -> Self

Returns an empty, unallocated, arbitrary-length byte array.
source§

impl NewBytes for Protected<HeapBytes, ReadWrite, Locked>

source§

fn new_bytes() -> Self

Returns an empty, unallocated, arbitrary-length byte array.
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, Locked>

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.