pub struct EncodingMask(/* private fields */);Expand description
A bitmask representing the Encodings employed while encoding a Parquet column chunk.
The Parquet ColumnMetaData struct contains an array that indicates what encodings were
used when writing that column chunk. For memory and performance reasons, this crate reduces
that array to bitmask, where each bit position represents a different Encoding. This
struct contains that bitmask, and provides methods to interact with the data.
§Example
// read parquet metadata from a file
let file = open_parquet_file("some_path.parquet");
let mut reader = ParquetMetaDataReader::new();
reader.try_parse(&file).unwrap();
let metadata = reader.finish().unwrap();
// find the encodings used by the first column chunk in the first row group
let col_meta = metadata.row_group(0).column(0);
let encodings = col_meta.encodings_mask();
// check to see if a particular encoding was used
let used_rle = encodings.is_set(Encoding::RLE);
// check to see if all of a set of encodings were used
let used_all = encodings.all_set([Encoding::RLE, Encoding::PLAIN].iter());
// convert mask to a Vec<Encoding>
let encodings_vec = encodings.encodings().collect::<Vec<_>>();Implementations§
Source§impl EncodingMask
impl EncodingMask
Sourcepub fn try_new(val: i32) -> Result<Self>
pub fn try_new(val: i32) -> Result<Self>
Attempt to create a new EncodingMask from an integer.
This will return an error if a bit outside the allowable range is set.
Sourcepub fn new_from_encodings<'a>(
encodings: impl Iterator<Item = &'a Encoding>,
) -> Self
pub fn new_from_encodings<'a>( encodings: impl Iterator<Item = &'a Encoding>, ) -> Self
Create a new EncodingMask from a collection of Encodings.
Trait Implementations§
Source§impl Clone for EncodingMask
impl Clone for EncodingMask
Source§fn clone(&self) -> EncodingMask
fn clone(&self) -> EncodingMask
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EncodingMask
impl Debug for EncodingMask
Source§impl Default for EncodingMask
impl Default for EncodingMask
Source§fn default() -> EncodingMask
fn default() -> EncodingMask
Returns the “default value” for a type. Read more
Source§impl PartialEq for EncodingMask
impl PartialEq for EncodingMask
impl Copy for EncodingMask
impl Eq for EncodingMask
impl StructuralPartialEq for EncodingMask
Auto Trait Implementations§
impl Freeze for EncodingMask
impl RefUnwindSafe for EncodingMask
impl Send for EncodingMask
impl Sync for EncodingMask
impl Unpin for EncodingMask
impl UnwindSafe for EncodingMask
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