pub struct SectionHeader {
pub compression_algo: u8,
pub format: Format,
pub more_sections: bool,
pub num_operations: u32,
pub num_add_bytes: u32,
pub output_size: u32,
}
Expand description
Header struct for a section
Fields§
§compression_algo: u8
Should be a value between 0-7 per the spec
format: Format
§more_sections: bool
true if there are more sections to decode after this one. false if this is the last section default: false
num_operations: u32
Total number of operations in the section
num_add_bytes: u32
Total Add bytes at the end of the section (not needed for interleaved format)
output_size: u32
Total output size generated from the operations in this section Maximum value should not exceed (1<<24) - 1
Implementations§
Source§impl SectionHeader
impl SectionHeader
Sourcepub fn new(num_operations: u32, num_add_bytes: u32, output_size: u32) -> Self
pub fn new(num_operations: u32, num_add_bytes: u32, output_size: u32) -> Self
Create a new SectionHeader with the given parameters
- num_operations: Total number of operations in the section
- num_add_bytes: Total Add bytes at the end of the section (not needed for interleaved format)
- output_size: Total output size generated from the operations in this section
Sourcepub fn set_compression_algo(self, compression_algo: u8) -> Self
pub fn set_compression_algo(self, compression_algo: u8) -> Self
Set the compression algorithm to use for this section
- compression_algo: Should be a value between 0-7 per the spec
pub fn set_format(self, format: Format) -> Self
Sourcepub fn set_more_sections(self, more_sections: bool) -> Self
pub fn set_more_sections(self, more_sections: bool) -> Self
Indicate if this section is not the last section
pub fn is_compressed(&self) -> bool
pub fn is_interleaved(&self) -> bool
Trait Implementations§
Source§impl Clone for SectionHeader
impl Clone for SectionHeader
Source§fn clone(&self) -> SectionHeader
fn clone(&self) -> SectionHeader
Returns a copy 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 SectionHeader
impl Debug for SectionHeader
Source§impl Default for SectionHeader
impl Default for SectionHeader
Source§fn default() -> SectionHeader
fn default() -> SectionHeader
Returns the “default value” for a type. Read more
Source§impl PartialEq for SectionHeader
impl PartialEq for SectionHeader
impl Copy for SectionHeader
impl StructuralPartialEq for SectionHeader
Auto Trait Implementations§
impl Freeze for SectionHeader
impl RefUnwindSafe for SectionHeader
impl Send for SectionHeader
impl Sync for SectionHeader
impl Unpin for SectionHeader
impl UnwindSafe for SectionHeader
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