pub struct Writer<W: Write + Seek> { /* private fields */ }
Expand description
Writes sparse blocks to a sparse image.
Implementations§
Source§impl<W: Write + Seek> Writer<W>
impl<W: Write + Seek> Writer<W>
Sourcepub fn new(w: W) -> Result<Self>
pub fn new(w: W) -> Result<Self>
Creates a new writer that writes to w
.
The created writer skips checksum calculation in favor of
speed. To get a writer that does checksum calculation, use
Writer::with_crc
instead.
Sourcepub fn with_crc(w: W) -> Result<Self>
pub fn with_crc(w: W) -> Result<Self>
Creates a new writer that writes to w
and adds a checksum
at the end.
Sourcepub fn write_block(&mut self, block: &Block) -> Result<()>
pub fn write_block(&mut self, block: &Block) -> Result<()>
Writes a sparse block to this writer.
The sparse block is converted into the sparse file format and written to this decoder’s destination.
Trait Implementations§
Auto Trait Implementations§
impl<W> Freeze for Writer<W>where
W: Freeze,
impl<W> RefUnwindSafe for Writer<W>where
W: RefUnwindSafe,
impl<W> Send for Writer<W>where
W: Send,
impl<W> Sync for Writer<W>where
W: Sync,
impl<W> Unpin for Writer<W>where
W: Unpin,
impl<W> UnwindSafe for Writer<W>where
W: UnwindSafe,
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