pub trait MemoryFileView:
Debug
+ Send
+ Sync
+ 'static {
// Required method
fn read_optional(&self, path: &Path) -> RuntimeResult<Option<String>>;
}Expand description
A read-only view of the files that describe process memory constraints.
Production uses HostMemoryFileView. The abstraction exists so cgroup
layouts, namespace roots, and read failures can be exercised deterministically
without a host that is configured that way.
Required Methods§
Sourcefn read_optional(&self, path: &Path) -> RuntimeResult<Option<String>>
fn read_optional(&self, path: &Path) -> RuntimeResult<Option<String>>
Reads one file, returning None when the path does not exist.
§Errors
Returns an operational error for a file that exists and cannot be read, so a permission or I/O failure is not mistaken for an absent constraint.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".