pub struct LayerTable {
pub table_version: u32,
pub layer_count: u32,
pub entry_size: u32,
pub entry_count: u32,
pub entries: Vec<LayerEntry>,
/* private fields */
}Expand description
The LTBL chunk.
Fields§
§table_version: u32Layout version. 1 for this specification.
layer_count: u32Layers the table describes, which must equal HEAD.total_layers.
entry_size: u32Bytes per entry; readers stride by this and skip unknown trailing fields.
entry_count: u32Entries in the table.
entries: Vec<LayerEntry>Every entry, in table order.
Implementations§
Source§impl LayerTable
impl LayerTable
Sourcepub fn parse(payload: &[u8]) -> Result<LayerTable>
pub fn parse(payload: &[u8]) -> Result<LayerTable>
Parse the chunk payload.
Sourcepub fn new(entries: Vec<LayerEntry>, layer_count: u32) -> Result<LayerTable>
pub fn new(entries: Vec<LayerEntry>, layer_count: u32) -> Result<LayerTable>
Build a table over entries, which must account for layer_count
layers exactly as LayerTable::parse requires of a file.
Sourcepub fn layer_entries(&self, layer: u32) -> &[LayerEntry]
pub fn layer_entries(&self, layer: u32) -> &[LayerEntry]
The entries of layer layer, its first entry included.
Empty when the table describes no such layer.
Sourcepub fn first_entry(&self, layer: u32) -> Option<&LayerEntry>
pub fn first_entry(&self, layer: u32) -> Option<&LayerEntry>
The first entry of layer layer, which is sector 0’s.
Sourcepub fn entry(&self, layer: u32, sector_id: u32) -> Option<&LayerEntry>
pub fn entry(&self, layer: u32, sector_id: u32) -> Option<&LayerEntry>
The entry for (layer, sector_id).
Sourcepub fn is_multi_sector(&self) -> bool
pub fn is_multi_sector(&self) -> bool
Whether some layer carries more than one sector with data.
A layer carries a sector when its entry for it holds bytes, so an entry
that exists only to point at an LROV chunk does not make a file
multi-sector. This is what the MULTI_SECTOR header flag asserts.
Trait Implementations§
Source§impl Clone for LayerTable
impl Clone for LayerTable
Source§fn clone(&self) -> LayerTable
fn clone(&self) -> LayerTable
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more