Trait cluFlock::Flock

source ·
pub trait Flock<'a>: Debug {
    type ExclusiveLock: FlockLock + 'a;
    type ExclusiveSliceLock: FlockLock + 'a;
    type SharedLock: FlockLock + 'a;
    type SharedSliceLock: FlockLock + 'a;

    fn try_exclusive_lock(
        &'a self
    ) -> Result<Option<Self::ExclusiveSliceLock>, Error>; fn exclusive_lock(&'a self) -> Result<Self::ExclusiveSliceLock, Error>; fn file_exclusive_lock(self) -> Result<Self::ExclusiveLock, Error>; fn try_file_exclusive_lock(
        self
    ) -> Result<Option<Self::ExclusiveLock>, Error>; fn try_shared_lock(&'a self) -> Result<Option<Self::SharedSliceLock>, Error>; fn shared_lock(&'a self) -> Result<Self::SharedSliceLock, Error>; fn file_shared_lock(self) -> Result<Self::SharedLock, Error>; fn try_file_shared_lock(self) -> Result<Option<Self::SharedLock>, Error>; }

Required Associated Types§

Required Methods§

Set exclusive lock. Lock current thread in case of file lock. Only one process can retain exclusive lock of the file.

Set exclusive lock. Lock current thread in case of file lock. Only one process can retain exclusive lock of the file.

Set shared lock. Lock current thread in case of file lock. Can retain the general lock on the given file more than one process.

Set shared lock. Lock current thread in case of file lock. Can retain the general lock on the given file more than one process.

Implementations on Foreign Types§

Implementors§