pub struct AsyncTempDirectory(/* private fields */);Expand description
A facade-owned asynchronous temporary directory.
§Examples
use qubit_fs::temp::{TempOptions, TempResourceState};
let mut temporary = filesystem.create_temp_directory(TempOptions::default()).await?;
temporary.cleanup().await?;
assert_eq!(TempResourceState::Cleaned, temporary.state());Implementations§
Source§impl AsyncTempDirectory
impl AsyncTempDirectory
Sourcepub const fn state(&self) -> TempResourceState
pub const fn state(&self) -> TempResourceState
Returns the current ownership lifecycle state.
§Returns
The handle’s current cleanup and publication 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 keep(&mut self) -> SpiFuture<'_, Result<PersistOutcome, PersistFailure>>
pub fn keep(&mut self) -> SpiFuture<'_, Result<PersistOutcome, PersistFailure>>
Sourcepub fn persist<'a>(
&'a mut self,
target: &'a Path,
options: PersistOptions,
) -> SpiFuture<'a, Result<PersistOutcome, PersistFailure>>
pub fn persist<'a>( &'a mut self, target: &'a Path, options: PersistOptions, ) -> SpiFuture<'a, Result<PersistOutcome, PersistFailure>>
Asynchronously persists this directory to a validated destination.
§Parameters
target: Validated destination path.options: Persistence atomicity and publication requirements.
§Returns
A future resolving to the confirmed persistence outcome.
§Errors
Resolves to a typed failure for invalid lifecycle state, failed local preflight, provider failure, or provider contract violation.
Auto Trait Implementations§
impl !RefUnwindSafe for AsyncTempDirectory
impl !Sync for AsyncTempDirectory
impl !UnwindSafe for AsyncTempDirectory
impl Freeze for AsyncTempDirectory
impl Send for AsyncTempDirectory
impl Unpin for AsyncTempDirectory
impl UnsafeUnpin for AsyncTempDirectory
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