pub struct RleEncoder;Expand description
Run-Length Encoder for data with repeated consecutive values.
Implementations§
Source§impl RleEncoder
impl RleEncoder
Sourcepub fn encode_i64(values: &[i64]) -> Result<Vec<u8>>
pub fn encode_i64(values: &[i64]) -> Result<Vec<u8>>
Encode a slice of i64 values using run-length encoding.
§Errors
Returns EncodingError::EmptyInput if values is empty, or
EncodingError::CorruptData if the count exceeds u32::MAX.
Sourcepub fn encode_u64(values: &[u64]) -> Result<Vec<u8>>
pub fn encode_u64(values: &[u64]) -> Result<Vec<u8>>
Encode a slice of u64 values using run-length encoding.
§Errors
Returns EncodingError::EmptyInput if values is empty.
Sourcepub fn encode_f64(values: &[f64]) -> Result<Vec<u8>>
pub fn encode_f64(values: &[f64]) -> Result<Vec<u8>>
Encode a slice of f64 values using run-length encoding.
Uses to_bits() for equality comparison so that NaN == NaN.
§Errors
Returns EncodingError::EmptyInput if values is empty.
Sourcepub fn encode_bool(values: &[bool]) -> Result<Vec<u8>>
pub fn encode_bool(values: &[bool]) -> Result<Vec<u8>>
Encode a slice of bool values using run-length encoding.
§Errors
Returns EncodingError::EmptyInput if values is empty.
Sourcepub fn encode_string(values: &[&str]) -> Result<Vec<u8>>
pub fn encode_string(values: &[&str]) -> Result<Vec<u8>>
Encode a slice of string references using run-length encoding.
§Errors
Returns EncodingError::EmptyInput if values is empty.
Auto Trait Implementations§
impl Freeze for RleEncoder
impl RefUnwindSafe for RleEncoder
impl Send for RleEncoder
impl Sync for RleEncoder
impl Unpin for RleEncoder
impl UnsafeUnpin for RleEncoder
impl UnwindSafe for RleEncoder
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