Trait dryoc::protected::Lockable

source ·
pub trait Lockable<A: Zeroize + Bytes> {
    // Required method
    fn mlock(self) -> Result<Protected<A, ReadWrite, Locked>, Error>;
}
Available on crate feature nightly only.
Expand description

A region of memory that can be locked, but is not yet protected. In order to lock the memory, it may require making a copy.

Required Methods§

source

fn mlock(self) -> Result<Protected<A, ReadWrite, Locked>, Error>

Consumes self, creates a new protected region of memory, and returns the result in a heap-allocated, page-aligned region of memory. The memory is locked with 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().

Implementors§

source§

impl Lockable<HeapBytes> for HeapBytes

source§

impl<const LENGTH: usize> Lockable<HeapByteArray<LENGTH>> for HeapByteArray<LENGTH>