pub struct DictionaryBuilder { /* private fields */ }Expand description
Builder for collecting samples and training a dictionary.
Implementations§
Source§impl DictionaryBuilder
impl DictionaryBuilder
Sourcepub fn max_samples(self, max: usize) -> Self
pub fn max_samples(self, max: usize) -> Self
Set the maximum number of samples to collect.
Sourcepub fn add_sample(&mut self, sample: Vec<u8>)
pub fn add_sample(&mut self, sample: Vec<u8>)
Add a sample for training.
Sourcepub fn add_sample_slice(&mut self, sample: &[u8])
pub fn add_sample_slice(&mut self, sample: &[u8])
Add a sample from a slice.
Sourcepub fn sample_count(&self) -> usize
pub fn sample_count(&self) -> usize
Get the current number of samples.
Sourcepub fn build(self) -> Result<CompressionDictionary>
pub fn build(self) -> Result<CompressionDictionary>
Train a dictionary from collected samples.
Trait Implementations§
Source§impl Default for DictionaryBuilder
impl Default for DictionaryBuilder
Source§fn default() -> DictionaryBuilder
fn default() -> DictionaryBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DictionaryBuilder
impl RefUnwindSafe for DictionaryBuilder
impl Send for DictionaryBuilder
impl Sync for DictionaryBuilder
impl Unpin for DictionaryBuilder
impl UnsafeUnpin for DictionaryBuilder
impl UnwindSafe for DictionaryBuilder
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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