Skip to main content

TarStreamSink

Struct TarStreamSink 

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

Sink that streams a tar archive (optionally codec-wrapped) to a Write. Hard links are materialised (tar copies the body).

Implementations§

Source§

impl TarStreamSink

Source

pub fn new(inner: Box<dyn Write>) -> Self

Source

pub fn bytes_written(&self) -> u64

Plain (uncompressed) bytes written so far — used by the CLI’s completion message.

Trait Implementations§

Source§

impl RepackSink for TarStreamSink

Source§

fn put_dir( &mut self, path: &str, meta: RepackMeta, xattrs: &[XattrPair], ) -> Result<()>

Source§

fn put_file( &mut self, path: &str, body: &mut dyn Read, len: u64, meta: RepackMeta, xattrs: &[XattrPair], ) -> Result<()>

Source§

fn put_device( &mut self, path: &str, kind: DeviceKind, major: u32, minor: u32, meta: RepackMeta, xattrs: &[XattrPair], ) -> Result<()>

Create path as a hard link to the already-emitted target. Returns Ok(false) when the sink can’t represent hard links — the walker then materialises the body with a fresh Self::put_file.
Source§

fn finish(&mut self) -> Result<()>

Finalise the destination (flush / write the archive trailer).
Source§

fn materialise_copy( &mut self, _path: &str, _target: &str, _meta: RepackMeta, _xattrs: &[XattrPair], ) -> Result<()>

Materialise path as an independent copy of the already-written target. Used by the streaming tar walker when put_hardlink returns false (the destination can’t represent a hard link) and the source body has already streamed past — so the copy is sourced from the destination, not the source. Default errors; only FsSink implements it.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.