pub struct DurableRoot { /* private fields */ }Expand description
Descriptor-pinned root for durable state owned by a database.
Every relative operation rejects .., symlinks, reparse points, and
non-regular final files. Unix operations stay descriptor-relative. Windows
keeps the root and each traversed ancestor open without delete sharing.
Implementations§
Source§impl DurableRoot
impl DurableRoot
pub fn try_clone(&self) -> Result<Self>
pub fn open(root: impl AsRef<Path>) -> Result<Self>
pub fn canonical_path(&self) -> &Path
Sourcepub fn io_path(&self) -> Result<PathBuf>
pub fn io_path(&self) -> Result<PathBuf>
Stable operational path backed by the pinned directory descriptor.
Use this for legacy path-based code while the DurableRoot stays alive.
pub fn open_directory(&self, relative: impl AsRef<Path>) -> Result<DurableRoot>
pub fn create_directory_all(&self, relative: impl AsRef<Path>) -> Result<()>
pub fn create_directory_all_pinned( &self, relative: impl AsRef<Path>, ) -> Result<DurableRoot>
pub fn create_directory_new(&self, relative: impl AsRef<Path>) -> Result<()>
pub fn open_regular(&self, relative: impl AsRef<Path>) -> Result<File>
pub fn entry_exists(&self, relative: impl AsRef<Path>) -> Result<bool>
pub fn write_new(&self, relative: impl AsRef<Path>, bytes: &[u8]) -> Result<()>
pub fn copy_new_from( &self, relative: impl AsRef<Path>, source: &mut File, ) -> Result<u64>
pub fn write_atomic( &self, relative: impl AsRef<Path>, bytes: &[u8], ) -> Result<()>
pub fn open_lock_file(&self, relative: impl AsRef<Path>) -> Result<File>
pub fn list_regular_files( &self, relative: impl AsRef<Path>, ) -> Result<Vec<OsString>>
pub fn remove_file(&self, relative: impl AsRef<Path>) -> Result<()>
pub fn rename_directory_new( &self, source: impl AsRef<Path>, destination_root: &DurableRoot, destination: impl AsRef<Path>, ) -> Result<()>
pub fn rename_directory_new_with_after<F>(
&self,
source: impl AsRef<Path>,
destination_root: &DurableRoot,
destination: impl AsRef<Path>,
after_publish: F,
) -> Result<()>where
F: FnOnce(),
pub fn remove_directory_all(&self, relative: impl AsRef<Path>) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DurableRoot
impl RefUnwindSafe for DurableRoot
impl Send for DurableRoot
impl Sync for DurableRoot
impl Unpin for DurableRoot
impl UnsafeUnpin for DurableRoot
impl UnwindSafe for DurableRoot
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more