pub struct PlainEncoder;Expand description
Plain (uncompressed) encoder.
Implementations§
Source§impl PlainEncoder
impl PlainEncoder
Sourcepub fn encode_bool(values: &[bool]) -> Result<Vec<u8>>
pub fn encode_bool(values: &[bool]) -> Result<Vec<u8>>
Encode boolean values uncompressed (1 byte per bool).
§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 string values uncompressed (length-prefixed).
§Errors
Returns EncodingError::EmptyInput if values is empty.
Sourcepub fn encode_bytes(values: &[&[u8]]) -> Result<Vec<u8>>
pub fn encode_bytes(values: &[&[u8]]) -> Result<Vec<u8>>
Encode a byte-string column.
The same wire shape as encode_string — a
count, then a u32 length and that many bytes per value — without the
UTF-8 constraint. It exists for native histograms, whose values are
composite objects with no numeric representation to compress.
§Errors
EncodingError::EmptyInput for no values, or
EncodingError::CorruptData for a value longer than u32::MAX.
Trait Implementations§
Source§impl Clone for PlainEncoder
impl Clone for PlainEncoder
Source§fn clone(&self) -> PlainEncoder
fn clone(&self) -> PlainEncoder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PlainEncoder
Auto Trait Implementations§
impl Freeze for PlainEncoder
impl RefUnwindSafe for PlainEncoder
impl Send for PlainEncoder
impl Sync for PlainEncoder
impl Unpin for PlainEncoder
impl UnsafeUnpin for PlainEncoder
impl UnwindSafe for PlainEncoder
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