file_ext.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::errors::{ Result }; pub trait FileExt { type LockGuard; fn lock_shared(&self) -> Result<Self::LockGuard>; fn lock_exclusive(&self) -> Result<Self::LockGuard>; fn try_lock_shared(&self) -> Result<Self::LockGuard>; fn try_lock_exclusive(&self) -> Result<Self::LockGuard>; }