pub trait Lock<A: Zeroize + Bytes, PM: ProtectMode> {
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§
sourcefn mlock(self) -> Result<Protected<A, PM, Locked>, Error>
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()
.