Struct fd_lock::FdLock[][src]

pub struct FdLock<T: AsRawFd> { /* fields omitted */ }
Expand description

A file descriptor lock.

Implementations

Create a new instance.

Acquires a new lock, blocking the current thread until it’s able to do so.

This function will block the local thread until it is available to acquire the lock. Upon returning, the thread is the only thread with the lock held. An RAII guard is returned to allow scoped unlock of the lock. When the guard goes out of scope, the lock will be unlocked.

Errors

On Unix this may return an error if the operation was interrupted by a signal handler.

Attempts to acquire an advisory lock.

Unlike FdLock::lock this function will never block, but instead will return an error if the lock cannot be acquired.

Errors

If the lock is already held and ErrorKind::WouldBlock error is returned. This may also return an error if the operation was interrupted by a signal handler.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.