pub struct HeaderFields;
Expand description
Bitfields for writing and reading segments of the header and payload of
inspect VMO blocks.
Represents the header structure of an inspect VMO Block. Not to confuse with
the HEADER
block.
Implementations§
Source§impl HeaderFields
impl HeaderFields
Sourcepub fn order<T: Deref<Target = Q>, Q: ReadBytes>(b: &Block<T>) -> u8
pub fn order<T: Deref<Target = Q>, Q: ReadBytes>(b: &Block<T>) -> u8
The size of a block given as a bit shift from the minimum size.
size_in_bytes = 16 << order
. Separates blocks into classes by their (power of two) size.
Sourcepub fn set_order<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>(
b: &mut Block<T>,
value: u8,
)
pub fn set_order<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>( b: &mut Block<T>, value: u8, )
The size of a block given as a bit shift from the minimum size.
size_in_bytes = 16 << order
. Separates blocks into classes by their (power of two) size.
Sourcepub fn block_type<T: Deref<Target = Q>, Q: ReadBytes>(b: &Block<T>) -> u8
pub fn block_type<T: Deref<Target = Q>, Q: ReadBytes>(b: &Block<T>) -> u8
The type of the block. Determines how the rest of the bytes are interpreted.
- 0: Free
- 1: Reserved
- 2: Header
- 3: Node
- 4: Int value
- 5: Uint value
- 6: Double value
- 7: Buffer value
- 8: Extent
- 9: Name
- 10: Tombstone
- 11: Array value
- 12: Link value
- 13: Bool value
- 14: String Reference
Sourcepub fn set_block_type<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>(
b: &mut Block<T>,
value: u8,
)
pub fn set_block_type<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>( b: &mut Block<T>, value: u8, )
The type of the block. Determines how the rest of the bytes are interpreted.
- 0: Free
- 1: Reserved
- 2: Header
- 3: Node
- 4: Int value
- 5: Uint value
- 6: Double value
- 7: Buffer value
- 8: Extent
- 9: Name
- 10: Tombstone
- 11: Array value
- 12: Link value
- 13: Bool value
- 14: String Reference
Sourcepub fn header_version<T: Deref<Target = Q>, Q: ReadBytes>(b: &Block<T>) -> u32
pub fn header_version<T: Deref<Target = Q>, Q: ReadBytes>(b: &Block<T>) -> u32
Only for a HEADER
block. The version number. Currently 1.
Sourcepub fn set_header_version<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>(
b: &mut Block<T>,
value: u32,
)
pub fn set_header_version<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>( b: &mut Block<T>, value: u32, )
Only for a HEADER
block. The version number. Currently 1.
Sourcepub fn header_magic<T: Deref<Target = Q>, Q: ReadBytes>(b: &Block<T>) -> u32
pub fn header_magic<T: Deref<Target = Q>, Q: ReadBytes>(b: &Block<T>) -> u32
Only for a HEADER
block. The magic number “INSP”.
Sourcepub fn set_header_magic<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>(
b: &mut Block<T>,
value: u32,
)
pub fn set_header_magic<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>( b: &mut Block<T>, value: u32, )
Only for a HEADER
block. The magic number “INSP”.
Sourcepub fn value_name_index<T: Deref<Target = Q>, Q: ReadBytes>(b: &Block<T>) -> u32
pub fn value_name_index<T: Deref<Target = Q>, Q: ReadBytes>(b: &Block<T>) -> u32
Only for *_VALUE
blocks. The index of the NAME
block of associated with this value.
Sourcepub fn set_value_name_index<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>(
b: &mut Block<T>,
value: u32,
)
pub fn set_value_name_index<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>( b: &mut Block<T>, value: u32, )
Only for *_VALUE
blocks. The index of the NAME
block of associated with this value.
Sourcepub fn value_parent_index<T: Deref<Target = Q>, Q: ReadBytes>(
b: &Block<T>,
) -> u32
pub fn value_parent_index<T: Deref<Target = Q>, Q: ReadBytes>( b: &Block<T>, ) -> u32
Only for *_VALUE
blocks. The index of the parent of this value.
Sourcepub fn set_value_parent_index<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>(
b: &mut Block<T>,
value: u32,
)
pub fn set_value_parent_index<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>( b: &mut Block<T>, value: u32, )
Only for *_VALUE
blocks. The index of the parent of this value.
pub fn reserved_empty<T: Deref<Target = Q>, Q: ReadBytes>(b: &Block<T>) -> u64
pub fn set_reserved_empty<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>( b: &mut Block<T>, value: u64, )
pub fn tombstone_empty<T: Deref<Target = Q>, Q: ReadBytes>(b: &Block<T>) -> u64
pub fn set_tombstone_empty<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>( b: &mut Block<T>, value: u64, )
Sourcepub fn free_reserved<T: Deref<Target = Q>, Q: ReadBytes>(b: &Block<T>) -> u8
pub fn free_reserved<T: Deref<Target = Q>, Q: ReadBytes>(b: &Block<T>) -> u8
Only for FREE
blocks. The index of the next free block.
Sourcepub fn set_free_reserved<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>(
b: &mut Block<T>,
value: u8,
)
pub fn set_free_reserved<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>( b: &mut Block<T>, value: u8, )
Only for FREE
blocks. The index of the next free block.
pub fn free_next_index<T: Deref<Target = Q>, Q: ReadBytes>(b: &Block<T>) -> u32
pub fn set_free_next_index<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>( b: &mut Block<T>, value: u32, )
pub fn free_empty<T: Deref<Target = Q>, Q: ReadBytes>(b: &Block<T>) -> u32
pub fn set_free_empty<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>( b: &mut Block<T>, value: u32, )
Sourcepub fn name_length<T: Deref<Target = Q>, Q: ReadBytes>(b: &Block<T>) -> u16
pub fn name_length<T: Deref<Target = Q>, Q: ReadBytes>(b: &Block<T>) -> u16
Only for NAME
blocks. The length of the string.
Sourcepub fn set_name_length<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>(
b: &mut Block<T>,
value: u16,
)
pub fn set_name_length<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>( b: &mut Block<T>, value: u16, )
Only for NAME
blocks. The length of the string.
Sourcepub fn extent_next_index<T: Deref<Target = Q>, Q: ReadBytes>(
b: &Block<T>,
) -> u32
pub fn extent_next_index<T: Deref<Target = Q>, Q: ReadBytes>( b: &Block<T>, ) -> u32
Only for EXTENT
or STRING_REFERENCE
blocks.
The index of the next EXTENT
block.
Sourcepub fn set_extent_next_index<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>(
b: &mut Block<T>,
value: u32,
)
pub fn set_extent_next_index<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>( b: &mut Block<T>, value: u32, )
Only for EXTENT
or STRING_REFERENCE
blocks.
The index of the next EXTENT
block.
Sourcepub fn string_reference_count<T: Deref<Target = Q>, Q: ReadBytes>(
b: &Block<T>,
) -> u32
pub fn string_reference_count<T: Deref<Target = Q>, Q: ReadBytes>( b: &Block<T>, ) -> u32
Only for STRING_REFERENCE
blocks.
The number of active references to the string, including itself.
Sourcepub fn set_string_reference_count<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>(
b: &mut Block<T>,
value: u32,
)
pub fn set_string_reference_count<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>( b: &mut Block<T>, value: u32, )
Only for STRING_REFERENCE
blocks.
The number of active references to the string, including itself.