Skip to main content

BoundMember

Struct BoundMember 

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

One extracted member proven by its already-open member object.

A bound member carries the same size/digest evidence as ExtractedMember, but its bytes are proven by object identity: handle is the exact object created by the atomic handle-relative write and verified during extraction, rewound to byte zero at handoff. Staging from this object performs no name lookup after the handoff boundary, so a concurrent member-entry replacement cannot redirect staged bytes.

The handle is single-owner and move-only. File cursors are shared across clones, so this type is deliberately not Clone: move the object into staging (see into_open_object), which rewinds it again before reading. Never try_clone a bound handle and assume an independent offset.

advisory_path is diagnostics only and explicitly non-authoritative: it may be stale (root renamed) or foreign (member entry replaced) while the handle still proves the owned bytes. Never stage by opening it.

Implementations§

Source§

impl BoundMember

Source

pub fn source_path(&self) -> &str

Returns the normalized archive path that supplied these bytes.

Source

pub fn output_name(&self) -> &str

Returns the output filename inside the extraction root.

Source

pub fn advisory_path(&self) -> &Path

Returns the recorded member pathname for diagnostics only.

Non-authoritative: may be stale or foreign after a root rename/replacement. Never open this path to obtain staged bytes; move into_open_object into staging instead.

Source

pub fn bytes_written(&self) -> u64

Returns the exact bytes written and verified.

Source

pub fn sha256(&self) -> [u8; 32]

Returns the SHA-256 digest of the extracted bytes.

Source

pub fn handle_mut(&mut self) -> &mut File ⓘ

Borrows the open member object, for example to prove cursor ownership in tests. The holder owns the shared cursor: any read/seek moves it for all borrowers, and staging rewinds to byte zero before reading.

Source

pub fn into_open_object(self) -> File ⓘ

Releases the already-open readable member object for staging.

The object arrives rewound to byte zero by into_bound_sources; staging must still rewind before reading (it does) so a cursor moved after handoff cannot truncate staged bytes.

Trait Implementations§

Source§

impl Debug for BoundMember

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.