diff options
Diffstat (limited to 'src/directory/directory.rs')
-rw-r--r-- | src/directory/directory.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/directory/directory.rs b/src/directory/directory.rs index 3e786c2..6b50925 100644 --- a/src/directory/directory.rs +++ b/src/directory/directory.rs @@ -48,14 +48,14 @@ impl RetryPolicy { /// /// It is transparently associated to a lock file, that gets deleted /// on `Drop.` The lock is released automatically on `Drop`. -pub struct DirectoryLock(Box<dyn Drop + Send + Sync + 'static>); +pub struct DirectoryLock(Box<dyn Send + Sync + 'static>); struct DirectoryLockGuard { directory: Box<dyn Directory>, path: PathBuf, } -impl<T: Drop + Send + Sync + 'static> From<Box<T>> for DirectoryLock { +impl<T: Send + Sync + 'static> From<Box<T>> for DirectoryLock { fn from(underlying: Box<T>) -> Self { DirectoryLock(underlying) } @@ -118,6 +118,8 @@ pub trait Directory: DirectoryClone + fmt::Debug + Send + Sync + 'static { /// /// Specifically, subsequent writes or flushes should /// have no effect on the returned `ReadOnlySource` object. + /// + /// You should only use this to read files create with [`open_write`] fn open_read(&self, path: &Path) -> result::Result<ReadOnlySource, OpenReadError>; /// Removes a file @@ -157,6 +159,8 @@ pub trait Directory: DirectoryClone + fmt::Debug + Send + Sync + 'static { /// atomic_write. /// /// This should only be used for small files. + /// + /// You should only use this to read files create with [`atomic_write`] fn atomic_read(&self, path: &Path) -> Result<Vec<u8>, OpenReadError>; /// Atomically replace the content of a file with data. |