Skip to main content

Lock

Struct Lock 

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

Exclusive hold on a run, released by the kernel however the process ends.

Implementations§

Source§

impl Lock

Source

pub fn acquire(run_dir: &RunDir) -> Result<Lock, LockError>

Source

pub fn acquire_file(path: PathBuf) -> Result<Lock, LockError>

Takes an exclusive non-blocking lock on an arbitrary lock file path.

Source

pub fn set_pgid(&mut self, pgid: Option<i32>) -> Result<(), LockError>

Records the running child’s process group, or None once it is reaped.

Trait Implementations§

Source§

impl Debug for Lock

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Forget for Lock

§

impl Freeze for Lock
where I32NotAllOnes: Freeze, *const u8 is !null: Freeze, PhantomData<u8>: Freeze,

§

impl Move for Lock

§

impl RefUnwindSafe for Lock
where I32NotAllOnes: RefUnwindSafe,

§

impl Send for Lock
where I32NotAllOnes: Send, RawVecInner: Send,

§

impl Sync for Lock
where I32NotAllOnes: Sync, RawVecInner: Sync,

§

impl Unpin for Lock
where I32NotAllOnes: Unpin, *const u8 is !null: Unpin,

§

impl UnsafeUnpin for Lock
where I32NotAllOnes: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin,

§

impl UnwindSafe for Lock
where I32NotAllOnes: UnwindSafe, RawVecInner: UnwindSafe,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.