Skip to main content

PersistedExtraction

Struct PersistedExtraction 

Source
pub struct PersistedExtraction { /* private fields */ }
Expand description

Extracted output whose cleanup responsibility has been transferred.

Implementations§

Source§

impl PersistedExtraction

Source

pub fn root(&self) -> &Path

Returns the retained private extraction root.

Source

pub fn members(&self) -> &[ExtractedMember]

Returns member evidence in declaration order.

Source

pub fn cleanup(self) -> Result<(), ExtractionError>

Empties the retained operation-owned extraction root through the retained root handle.

The crate empties the owned tree through the retained directory handle. It never removes the root directory itself and never traverses the root pathname, so a foreign directory, file, symlink, or reparse point installed at the recorded pathname is never touched.

§Contract
  • Ok means the owned root object held no entries at the final handle-relative listing: the owned tree was emptied.
  • Err with ExtractionErrorKind::CleanupFailed means the owned root could not be fully emptied. The residue may be partially emptied, its emptiness is not guaranteed, and ExtractionError::residue_path names the recorded root path.

The residual directory is the caller’s to remove: this crate never removes it and offers no convenience that removes it by pathname. Because this call consumes the value, capture the residual path from root before calling it.

The recorded root path is advisory: if the root was renamed or replaced by a third party, the crate emptied the owned object and left whatever occupies the recorded pathname untouched.

Source

pub fn into_bound_sources(self) -> Result<BoundExtraction, ExtractionError>

Converts every member into an object-bound staging source.

This is the handle-backed handoff: each returned BoundMember owns the already-open readable member object created by the atomic handle-relative write, rewound to byte zero, so later staging reads the verified object instead of re-resolving the recorded pathname or member name. Call this before any staging; a root rename or member replacement afterwards cannot redirect the bound objects.

Member handles are closed when their BoundMember is consumed or dropped. Run cleanup only after bound handles are consumed or closed (see BoundExtraction::into_members); residue remains acceptable under the same semantics as cleanup.

Trait Implementations§

Source§

impl Debug for PersistedExtraction

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.