pub struct CParams(/* private fields */);
Expand description
Wrapper to blosc2_cparams.
Compression parameters.
A normal way to construct this is using std::convert::From<&T>(val)
so it will create with default parameters and the correct typesize
.
§Example
use blosc2::CParams;
let values = vec![0u8, 1, 2, 3];
let cparams = CParams::new::<u8>()
.set_nthreads(2); // Optionally adjust default values
Implementations§
Source§impl CParams
impl CParams
pub fn new<T>() -> Self
pub fn from_typesize(typesize: usize) -> Self
Sourcepub fn set_codec(self, codec: Codec) -> Self
pub fn set_codec(self, codec: Codec) -> Self
Set codec, defaults to Codec::BloscLz
Sourcepub fn set_clevel(self, clevel: CLevel) -> Self
pub fn set_clevel(self, clevel: CLevel) -> Self
Set clevel, defaults to CLevel::Nine
Sourcepub fn set_filter(self, filter: Filter) -> Self
pub fn set_filter(self, filter: Filter) -> Self
Set filter, defaults to Filter::Shuffle
Sourcepub fn set_nthreads(self, n: usize) -> Self
pub fn set_nthreads(self, n: usize) -> Self
Set number of threads, defaults to 1
Sourcepub fn get_nthreads(&self) -> usize
pub fn get_nthreads(&self) -> usize
Get number of threads
Sourcepub fn set_typesize<T>(self) -> Self
pub fn set_typesize<T>(self) -> Self
Set the type size
pub fn get_typesize(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CParams
impl RefUnwindSafe for CParams
impl !Send for CParams
impl !Sync for CParams
impl Unpin for CParams
impl UnwindSafe for CParams
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