Type Alias dryoc::protected::ptypes::LockedRO

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

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

Aliased Type§

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

Trait Implementations§

source§

impl<T: Zeroize + NewBytes + ResizableBytes + Lockable<T> + NewLocked<T>> Clone for LockedRO<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 Serialize for LockedRO<HeapBytes>

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 + Bytes + AsRef<[u8]>, LM: LockMode> AsRef<[u8]> for Protected<A, ReadOnly, 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>, ReadOnly, 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, ReadOnly, 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 + 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, 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 + 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, ReadOnly, LM>

§

type Target = [u8]

The resulting type after dereferencing.
source§

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

Dereferences the value.