#[repr(C, packed(1))]pub struct GroupHeader {
pub block_length: u16,
pub num_in_group: u16,
}Expand description
Repeating group header (4 bytes).
The group header precedes each repeating group and contains:
- Block length: Size of each group entry in bytes
- Num in group: Number of entries in the group
§Wire Format
+0: blockLength (u16, 2 bytes)
+2: numInGroup (u16, 2 bytes)Fields§
§block_length: u16Length of each group entry in bytes.
num_in_group: u16Number of entries in the group.
Implementations§
Source§impl GroupHeader
impl GroupHeader
Sourcepub const ENCODED_LENGTH: usize = 4
pub const ENCODED_LENGTH: usize = 4
Encoded length of the group header in bytes.
Sourcepub const fn new(block_length: u16, num_in_group: u16) -> Self
pub const fn new(block_length: u16, num_in_group: u16) -> Self
Creates a new group header with the specified values.
§Arguments
block_length- Length of each group entry in bytesnum_in_group- Number of entries in the group
Sourcepub fn encode<B: WriteBuffer + ?Sized>(&self, buffer: &mut B, offset: usize)
pub fn encode<B: WriteBuffer + ?Sized>(&self, buffer: &mut B, offset: usize)
Encodes the group header to the buffer at the given offset.
§Arguments
buffer- Buffer to write tooffset- Byte offset to start writing
Sourcepub const fn group_size(&self) -> usize
pub const fn group_size(&self) -> usize
Returns the total size of the group (header + all entries).
Trait Implementations§
Source§impl Clone for GroupHeader
impl Clone for GroupHeader
Source§fn clone(&self) -> GroupHeader
fn clone(&self) -> GroupHeader
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 GroupHeader
impl Debug for GroupHeader
Source§impl Default for GroupHeader
impl Default for GroupHeader
Source§fn default() -> GroupHeader
fn default() -> GroupHeader
Returns the “default value” for a type. Read more
Source§impl PartialEq for GroupHeader
impl PartialEq for GroupHeader
impl Copy for GroupHeader
impl Eq for GroupHeader
impl StructuralPartialEq for GroupHeader
Auto Trait Implementations§
impl Freeze for GroupHeader
impl RefUnwindSafe for GroupHeader
impl Send for GroupHeader
impl Sync for GroupHeader
impl Unpin for GroupHeader
impl UnwindSafe for GroupHeader
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