pub trait CommandProcessLimitExt {
// Required method
fn set_process_limit(&mut self, limit: u64) -> Result<(), Error>;
}Available on Unix only.
Expand description
Extension trait for setting a command’s process limit before it runs.
Required Methods§
Sourcefn set_process_limit(&mut self, limit: u64) -> Result<(), Error>
fn set_process_limit(&mut self, limit: u64) -> Result<(), Error>
Arranges for the command to set its soft and hard RLIMIT_NPROC to
limit, or to its hard limit if that is lower, after it is forked
and before it runs its program. Only Linux sets it.
§Errors
error::ErrorKind::NotSupportedOnThisPlatform on a Unix other than
Linux, where nix names no RLIMIT_NPROC for every target; on
Linux, none here: a child that cannot set the limit fails its spawn.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".