pub struct FileTransaction { /* private fields */ }Expand description
Holds cooperative locks from the initial reads through all replacements.
Every output is staged before the first rename. Each rename is atomic, although replacing several different files cannot be a single filesystem transaction.
Implementations§
Source§impl FileTransaction
impl FileTransaction
Sourcepub fn new(paths: &[PathBuf]) -> Result<Self, AuthError>
pub fn new(paths: &[PathBuf]) -> Result<Self, AuthError>
Resolve and lock every path in sorted order, then read their contents.
Sourcepub fn contents(&self, path: &Path) -> Result<&str, AuthError>
pub fn contents(&self, path: &Path) -> Result<&str, AuthError>
Return the content read while the transaction held all requested locks.
Sourcepub fn existed(&self, path: &Path) -> Result<bool, AuthError>
pub fn existed(&self, path: &Path) -> Result<bool, AuthError>
Whether the path existed when the transaction read it.
Auto Trait Implementations§
impl Freeze for FileTransaction
impl RefUnwindSafe for FileTransaction
impl Send for FileTransaction
impl Sync for FileTransaction
impl Unpin for FileTransaction
impl UnsafeUnpin for FileTransaction
impl UnwindSafe for FileTransaction
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