pub struct CompressedPage {
compressed_page: Page,
uncompressed_size: usize,
}Expand description
Helper struct to represent pages with potentially compressed buffer (data page v1) or compressed and concatenated buffer (def levels + rep levels + compressed values for data page v2).
The difference with Page is that Page buffer is always uncompressed.
Fields§
§compressed_page: Page§uncompressed_size: usizeImplementations§
Source§impl CompressedPage
impl CompressedPage
Sourcepub fn new(compressed_page: Page, uncompressed_size: usize) -> Self
pub fn new(compressed_page: Page, uncompressed_size: usize) -> Self
Creates CompressedPage from a page with potentially compressed buffer and
uncompressed size.
Sourcepub fn compressed_page(&self) -> &Page
pub fn compressed_page(&self) -> &Page
Returns underlying page with potentially compressed buffer.
Sourcepub fn uncompressed_size(&self) -> usize
pub fn uncompressed_size(&self) -> usize
Returns uncompressed size in bytes.
Sourcepub fn compressed_size(&self) -> usize
pub fn compressed_size(&self) -> usize
Returns compressed size in bytes.
Note that it is assumed that buffer is compressed, but it may not be. In this case compressed size will be equal to uncompressed size.
Sourcepub fn num_values(&self) -> u32
pub fn num_values(&self) -> u32
Number of values in page.
Sourcepub(crate) fn to_thrift_header(&self) -> Result<PageHeader>
pub(crate) fn to_thrift_header(&self) -> Result<PageHeader>
Returns the thrift page header
Sourcepub(crate) fn with_new_compressed_buffer(self, new_buffer: Bytes) -> Self
pub(crate) fn with_new_compressed_buffer(self, new_buffer: Bytes) -> Self
Update the compressed buffer for a page. This might be required when encrypting page data for example. The size of uncompressed data must not change.
Auto Trait Implementations§
impl !Freeze for CompressedPage
impl RefUnwindSafe for CompressedPage
impl Send for CompressedPage
impl Sync for CompressedPage
impl Unpin for CompressedPage
impl UnwindSafe for CompressedPage
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
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>
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>
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