pub struct Record<const FILE_LOCK: bool> { /* private fields */ }Expand description
A record of file operations maintained in the graveyard directory
§Type Parameters
FILE_LOCK- Whentrue, exclusive file locks are acquired when opening the record file for reading or writing. This prevents concurrent access from multiple processes. Whenfalse, no file locking is performed - which is used for testing.
Implementations§
Source§impl<const FILE_LOCK: bool> Record<FILE_LOCK>
impl<const FILE_LOCK: bool> Record<FILE_LOCK>
pub fn new(graveyard: &Path) -> Self
pub fn open(&self) -> Result<File, Error>
Sourcepub fn get_last_bury(&self) -> Result<PathBuf, Error>
pub fn get_last_bury(&self) -> Result<PathBuf, Error>
Return the path in the graveyard of the last file to be buried. As a side effect, any valid last files that are found in the record but not on the filesystem are removed from the record.
pub fn log_exhumed_graves( &self, graves_to_exhume: &[PathBuf], ) -> Result<(), Error>
Sourcepub fn lines_of_graves<'a>(
&'a self,
graves: &'a [PathBuf],
) -> impl Iterator<Item = String> + 'a
pub fn lines_of_graves<'a>( &'a self, graves: &'a [PathBuf], ) -> impl Iterator<Item = String> + 'a
Takes a vector of grave paths and returns the respective lines in the record
Trait Implementations§
Auto Trait Implementations§
impl<const FILE_LOCK: bool> Freeze for Record<FILE_LOCK>
impl<const FILE_LOCK: bool> RefUnwindSafe for Record<FILE_LOCK>
impl<const FILE_LOCK: bool> Send for Record<FILE_LOCK>
impl<const FILE_LOCK: bool> Sync for Record<FILE_LOCK>
impl<const FILE_LOCK: bool> Unpin for Record<FILE_LOCK>
impl<const FILE_LOCK: bool> UnwindSafe for Record<FILE_LOCK>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more