pub struct CarWriterBuilder { /* private fields */ }Expand description
Builder for creating a CarWriter with optional compression.
§Examples
use ipfrs_core::{CidBuilder, car::CarWriterBuilder, compression::CompressionAlgorithm};
let cid = CidBuilder::new().build(b"root").unwrap();
let mut output = Vec::new();
let writer = CarWriterBuilder::new(vec![cid])
.with_compression(CompressionAlgorithm::Zstd, 3)
.build(&mut output)
.unwrap();Implementations§
Source§impl CarWriterBuilder
impl CarWriterBuilder
Sourcepub fn with_compression(
self,
algorithm: CompressionAlgorithm,
level: i32,
) -> Self
pub fn with_compression( self, algorithm: CompressionAlgorithm, level: i32, ) -> Self
Enable compression with the specified algorithm and level.
§Arguments
algorithm- The compression algorithm to uselevel- Compression level (0-9 for Zstd, 0-12 for Lz4)
Auto Trait Implementations§
impl Freeze for CarWriterBuilder
impl RefUnwindSafe for CarWriterBuilder
impl Send for CarWriterBuilder
impl Sync for CarWriterBuilder
impl Unpin for CarWriterBuilder
impl UnwindSafe for CarWriterBuilder
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more