Trait dryoc::protected::Lock

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

Protected region of memory that can be locked.

Required Methods§

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().

Implementors§

source§

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