pub struct FooterTail {
metadata_length: usize,
encrypted_footer: bool,
}
Expand description
Parsed Parquet footer tail (last 8 bytes of a Parquet file)
There are 8 bytes at the end of the Parquet footer with the following layout:
- 4 bytes for the metadata length
- 4 bytes for the magic bytes ‘PAR1’ or ‘PARE’ (encrypted footer)
+-----+------------------+
| len | 'PAR1' or 'PARE' |
+-----+------------------+
§Examples
// a non encrypted footer with 28 bytes of metadata
let last_8_bytes: [u8; 8] = [0x1C, 0x00, 0x00, 0x00, b'P', b'A', b'R', b'1'];
let footer_tail = FooterTail::try_from(last_8_bytes).unwrap();
assert_eq!(footer_tail.metadata_length(), 28);
assert_eq!(footer_tail.is_encrypted_footer(), false);
// an encrypted footer with 512 bytes of metadata
let last_8_bytes = vec![0x00, 0x02, 0x00, 0x00, b'P', b'A', b'R', b'E'];
let footer_tail = FooterTail::try_from(&last_8_bytes[..]).unwrap();
assert_eq!(footer_tail.metadata_length(), 512);
assert_eq!(footer_tail.is_encrypted_footer(), true);
Fields§
§metadata_length: usize
Implementations§
Sourcepub fn try_new(slice: &[u8; 8]) -> Result<FooterTail>
pub fn try_new(slice: &[u8; 8]) -> Result<FooterTail>
Try to decode the footer tail from the given 8 bytes
Sourcepub fn metadata_length(&self) -> usize
pub fn metadata_length(&self) -> usize
The length of the footer metadata in bytes
Whether the footer metadata is encrypted
Trait Implementations§
Source§fn clone(&self) -> FooterTail
fn clone(&self) -> FooterTail
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 moreAuto Trait Implementations§
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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