pub trait ProtectReadOnly<A: Zeroize + Bytes, PM: ProtectMode, LM: LockMode> {
// Required method
fn mprotect_readonly(self) -> Result<Protected<A, ReadOnly, LM>, Error>;
}Available on crate feature
protected only.Expand description
Protected region of memory that can be set as read-only.
Required Methods§
Sourcefn mprotect_readonly(self) -> Result<Protected<A, ReadOnly, LM>, Error>
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.
§Errors
Returns error::Error::Io if the page permissions cannot be changed.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".