pub struct TempDirectory { /* private fields */ }Expand description
Temporary directory retaining the provider session until lifecycle completion.
§Examples
use qubit_fs::temp::{TempOptions, TempResourceState};
let mut temporary = filesystem.create_temp_directory(TempOptions::default())?;
assert_eq!(TempResourceState::Owned, temporary.state());Implementations§
Source§impl TempDirectory
impl TempDirectory
Sourcepub const fn state(&self) -> TempResourceState
pub const fn state(&self) -> TempResourceState
Returns the resource lifecycle state.
Sourcepub fn child(&self, component: &PathComponent) -> Path
pub fn child(&self, component: &PathComponent) -> Path
Returns one lexically safe child path.
Sourcepub fn descendant(&self, relative: &RelativePath) -> Path
pub fn descendant(&self, relative: &RelativePath) -> Path
Returns one lexically safe descendant path.
Sourcepub fn persist(
&mut self,
target: &Path,
options: PersistOptions,
) -> Result<PersistOutcome, PersistFailure>
pub fn persist( &mut self, target: &Path, options: PersistOptions, ) -> Result<PersistOutcome, PersistFailure>
Persists this directory.
§Parameters
target: Destination path validated by the owning filesystem.options: Atomicity and publication requirements.
§Returns
The provider-confirmed publication outcome.
§Errors
Returns a typed failure for invalid lifecycle state, failed preflight, provider failure, or a provider contract violation.
Sourcepub fn keep(&mut self) -> Result<PersistOutcome, PersistFailure>
pub fn keep(&mut self) -> Result<PersistOutcome, PersistFailure>
Trait Implementations§
Source§impl Debug for TempDirectory
impl Debug for TempDirectory
Source§impl Drop for TempDirectory
impl Drop for TempDirectory
Auto Trait Implementations§
impl !RefUnwindSafe for TempDirectory
impl !Sync for TempDirectory
impl !UnwindSafe for TempDirectory
impl Freeze for TempDirectory
impl Send for TempDirectory
impl Unpin for TempDirectory
impl UnsafeUnpin for TempDirectory
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