Struct Writer

Source
pub struct Writer<W: ?Sized> { /* private fields */ }
Expand description

DwarFS section writer.

Implementations§

Source§

impl<W> Writer<W>

Source

pub fn new(w: W) -> Result<Self>

Create a default multi-threaded section writer.

Source

pub fn new_with_threads(w: W, thread_cnt: NonZero<usize>) -> Result<Self>

Create a section writer with specific parallelism.

Source§

impl<W: ?Sized> Writer<W>

Source

pub fn get_ref(&self) -> &W

Get a reference to the underlying writer.

Source

pub fn get_mut(&mut self) -> &mut W

Get a mutable reference tothe underlying writer.

Source

pub fn into_inner(self) -> W
where W: Sized,

Retrieve the ownership of the underlying reader.

Source§

impl<W: Write> Writer<W>

Source

pub fn section_count(&self) -> u32

Number of sections of initiated via write_section.

Source

pub fn finish(self) -> Result<W>

Finalize and seal the DwarFS archive.

Source

pub fn write_section( &mut self, section_type: SectionType, compression: CompressParam, payload: &[u8], ) -> Result<()>

Write a section with given (uncompressed) payload.

Source

pub fn write_metadata_sections( &mut self, metadata: &Metadata, compression: CompressParam, ) -> Result<()>

Write metadata sections METADATA_V2_{,_SCHEMA}.

Trait Implementations§

Source§

impl<W: Debug + ?Sized> Debug for Writer<W>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<W> Freeze for Writer<W>
where W: Freeze + ?Sized,

§

impl<W> !RefUnwindSafe for Writer<W>

§

impl<W> Send for Writer<W>
where W: Send + ?Sized,

§

impl<W> Sync for Writer<W>
where W: Sync + ?Sized,

§

impl<W> Unpin for Writer<W>
where W: Unpin + ?Sized,

§

impl<W> !UnwindSafe for Writer<W>

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 = 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.