Skip to main content

Job

Struct Job 

Source
pub struct Job { /* private fields */ }
Expand description

An owned Windows Job object.

Implementations§

Source§

impl Job

Source

pub fn create() -> Result<Self>

Creates an unnamed Job object.

§Errors

Returns the operating-system error if Job creation fails.

Source

pub fn from_handle(handle: OwnedHandle) -> Result<Self>

Adopts an existing handle after verifying it is a Job handle.

§Errors

Returns an error if Job limit information cannot be queried.

Source

pub fn duplicate(&self) -> Result<Self>

Creates an independent duplicate of this Job handle.

§Errors

Returns the operating-system error if duplication fails.

Source

pub fn assign(&self, child: &Child) -> Result<()>

Assigns an existing child to the Job.

§Errors

Returns an error when Windows rejects the Job assignment.

Source

pub fn terminate(&self, exit_code: u32) -> Result<()>

Terminates every process in the Job with exit_code.

§Errors

Returns the operating-system error if Job termination fails.

Source

pub fn set_kill_on_close(&self, enable: bool) -> Result<()>

Enables or disables kill-on-close without overwriting other Job limits.

§Errors

Returns an error if querying or updating Job limits fails.

Trait Implementations§

Source§

impl AsHandle for Job

Source§

fn as_handle(&self) -> BorrowedHandle<'_>

Borrows the handle. Read more
Source§

impl Debug for Job

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Job

§

impl RefUnwindSafe for Job

§

impl Send for Job

§

impl Sync for Job

§

impl Unpin for Job

§

impl UnsafeUnpin for Job

§

impl UnwindSafe for Job

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>,

Source§

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>,

Source§

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.