pub struct FrameDescriptor(/* private fields */);
Expand description
The first byte is called the Frame Header Descriptor
, and it describes what other fields
are present.
Implementations§
Source§impl FrameDescriptor
impl FrameDescriptor
Sourcepub fn frame_content_size_flag(&self) -> u8
pub fn frame_content_size_flag(&self) -> u8
Read the Frame_Content_Size_flag
from the frame header descriptor.
This is a 2 bit flag, specifying if the Frame_Content_Size
field is present
within the header. It notates the number of bytes used by Frame_Content_size
When this value is is 0, FCS_Field_Size
depends on Single_Segment_flag.
If the Single_Segment_flag
field is set in the frame header descriptor,
the size of the Frame_Content_Size
field of the header is 1 byte.
Otherwise, FCS_Field_Size
is 0, and the Frame_Content_Size
is not provided.
Flag Value (decimal) | Size of the Frame_Content_Size field in bytes |
---|---|
0 | 0 or 1 (see above) |
1 | 2 |
2 | 4 |
3 | 8 |
Sourcepub fn reserved_flag(&self) -> bool
pub fn reserved_flag(&self) -> bool
This bit is reserved for some future feature, a compliant decoder must ensure that this value is set to zero.
Sourcepub fn single_segment_flag(&self) -> bool
pub fn single_segment_flag(&self) -> bool
If this flag is set, data must be regenerated within a single continuous memory segment.
In this case, the Window_Descriptor
byte is skipped, but Frame_Content_Size
is present.
The decoder must allocate a memory segment equal to or larger than Frame_Content_Size
.
Sourcepub fn content_checksum_flag(&self) -> bool
pub fn content_checksum_flag(&self) -> bool
If this flag is set, a 32 bit Content_Checksum
will be present at the end of the frame.
Sourcepub fn dict_id_flag(&self) -> u8
pub fn dict_id_flag(&self) -> u8
This is a two bit flag telling if a dictionary ID is provided within the header. It also specifies the size of this field
Value (Decimal) | DID_Field_Size (bytes) |
---|---|
0 | 0 |
1 | 1 |
2 | 2 |
3 | 4 |
Sourcepub fn frame_content_size_bytes(&self) -> Result<u8, FrameDescriptorError>
pub fn frame_content_size_bytes(&self) -> Result<u8, FrameDescriptorError>
Read the size of the Frame_Content_size
field from the frame header descriptor, returning
the size in bytes.
If this value is zero, then the Frame_Content_Size
field is not present within the header.
Sourcepub fn dictionary_id_bytes(&self) -> Result<u8, FrameDescriptorError>
pub fn dictionary_id_bytes(&self) -> Result<u8, FrameDescriptorError>
Read the size of the Dictionary_ID
field from the frame header descriptor, returning the size in bytes.
If this value is zero, then the dictionary id is not present within the header,
and “It’s up to the decoder to know which dictionary to use.”