Struct win32job::ExtendedLimitInfo
source · pub struct ExtendedLimitInfo(/* private fields */);
Implementations§
source§impl ExtendedLimitInfo
impl ExtendedLimitInfo
Contains basic and extended limit information for a job object, with helper methods for
easy limit manipulation. To apply limits, pass the instance of this struct to
Job::create_with_limit_info
or job.set_extended_limit_info
.
sourcepub fn limit_working_memory(&mut self, min: usize, max: usize) -> &mut Self
pub fn limit_working_memory(&mut self, min: usize, max: usize) -> &mut Self
Causes all processes associated with the job to use the same minimum and maximum working set sizes
sourcepub fn limit_kill_on_job_close(&mut self) -> &mut Self
pub fn limit_kill_on_job_close(&mut self) -> &mut Self
Causes all processes associated with the job to terminate
when the last handle to the job is closed.
Note, that that drop
ing the Job
struct closes this handle, and if it’s the only handle
to the job the current process will terminate if it’s assign to that job.
sourcepub fn limit_priority_class(
&mut self,
priority_class: PriorityClass
) -> &mut Self
pub fn limit_priority_class( &mut self, priority_class: PriorityClass ) -> &mut Self
Causes all processes associated with the job to use the same priority class.
Note: Processes and threads cannot modify their priority class.
The calling process must enable the SE_INC_BASE_PRIORITY_NAME
privilege.
sourcepub fn limit_scheduling_class(&mut self, scheduling_class: u8) -> &mut Self
pub fn limit_scheduling_class(&mut self, scheduling_class: u8) -> &mut Self
Causes all processes in the job to use the same scheduling class.
The valid values are 0 to 9.
Use 0 for the least favorable scheduling class relative to other threads,
and 9 for the most favorable scheduling class relative to other threads.
By default, this value is 5.
Note: To use a scheduling class greater than 5,
the calling process must enable the SE_INC_BASE_PRIORITY_NAME
privilege.
sourcepub fn limit_affinity(&mut self, affinity: usize) -> &mut Self
pub fn limit_affinity(&mut self, affinity: usize) -> &mut Self
Causes all processes associated with the job to use the same processor affinity.
sourcepub fn clear_limits(&mut self) -> &mut Self
pub fn clear_limits(&mut self) -> &mut Self
Clear all limits.