pub struct ExtendedLimitInfo(/* private fields */);

Implementations§

source§

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.

source

pub fn new() -> Self

Return an empty extended info objects, without any limits.

source

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

source

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 droping 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.

source

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.

source

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.

source

pub fn limit_affinity(&mut self, affinity: usize) -> &mut Self

Causes all processes associated with the job to use the same processor affinity.

source

pub fn clear_limits(&mut self) -> &mut Self

Clear all limits.

Trait Implementations§

source§

impl Debug for ExtendedLimitInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ExtendedLimitInfo

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.