pub struct CarWriter<W> { /* private fields */ }Implementations§
Source§impl<W> CarWriter<W>
impl<W> CarWriter<W>
pub fn new(header: CarHeader, writer: W) -> Self
Sourcepub fn write_header(&mut self) -> Result<usize, Error>
pub fn write_header(&mut self) -> Result<usize, Error>
Forces the header to be written. Also called implicitly by write.
Returns the bytes written in this operation.
Sourcepub fn write<T>(&mut self, cid: Cid, data: T) -> Result<usize, Error>
pub fn write<T>(&mut self, cid: Cid, data: T) -> Result<usize, Error>
Writes header and stream of data to writer in Car format.
Returns the bytes written in this operation.
Sourcepub fn finish(self) -> Result<W, Error>
pub fn finish(self) -> Result<W, Error>
Finishes writing, including flushing and returns the writer.
Sourcepub fn into_inner(self) -> W
pub fn into_inner(self) -> W
Consumes the CarWriter and returns the underlying writer.
Trait Implementations§
Auto Trait Implementations§
impl<W> Freeze for CarWriter<W>where
W: Freeze,
impl<W> RefUnwindSafe for CarWriter<W>where
W: RefUnwindSafe,
impl<W> Send for CarWriter<W>where
W: Send,
impl<W> Sync for CarWriter<W>where
W: Sync,
impl<W> Unpin for CarWriter<W>where
W: Unpin,
impl<W> UnwindSafe for CarWriter<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