[][src]Struct pidlock::Pidlock

pub struct Pidlock { /* fields omitted */ }

A pid-centered lock. A lock is considered "acquired" when a file exists on disk at the path specified, containing the process id of the locking process.

Implementations

impl Pidlock[src]

pub fn new(path: &str) -> Self[src]

Create a new Pidlock at the provided path.

pub fn acquire(&mut self) -> Result<(), PidlockError>[src]

Acquire a lock.

pub fn locked(&self) -> bool[src]

Returns true when the lock is in an acquired state.

pub fn release(&mut self) -> Result<(), PidlockError>[src]

Release the lock.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.