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

source

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.

source

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.

source

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
source

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
source

pub fn header_version<T: Deref<Target = Q>, Q: ReadBytes>(b: &Block<T>) -> u32

Only for a HEADER block. The version number. Currently 1.

source

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.

source

pub fn header_magic<T: Deref<Target = Q>, Q: ReadBytes>(b: &Block<T>) -> u32

Only for a HEADER block. The magic number “INSP”.

source

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”.

source

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.

source

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.

source

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.

source

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.

source

pub fn reserved_empty<T: Deref<Target = Q>, Q: ReadBytes>(b: &Block<T>) -> u64

source

pub fn set_reserved_empty<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>( b: &mut Block<T>, value: u64 )

source

pub fn tombstone_empty<T: Deref<Target = Q>, Q: ReadBytes>(b: &Block<T>) -> u64

source

pub fn set_tombstone_empty<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>( b: &mut Block<T>, value: u64 )

source

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.

source

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.

source

pub fn free_next_index<T: Deref<Target = Q>, Q: ReadBytes>(b: &Block<T>) -> u32

source

pub fn set_free_next_index<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>( b: &mut Block<T>, value: u32 )

source

pub fn free_empty<T: Deref<Target = Q>, Q: ReadBytes>(b: &Block<T>) -> u32

source

pub fn set_free_empty<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>( b: &mut Block<T>, value: u32 )

source

pub fn name_length<T: Deref<Target = Q>, Q: ReadBytes>(b: &Block<T>) -> u16

Only for NAME blocks. The length of the string.

source

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.

source

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.

source

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.

source

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.

source

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.

source

pub fn value<T: Deref<Target = Q>, Q: ReadBytes>(b: &Block<T>) -> u64

Get the raw 64 bits of the header section of the block.

source

pub fn set_value<T: Deref<Target = Q> + DerefMut<Target = Q>, Q: WriteBytes + ReadBytes>( b: &mut Block<T>, value: u64 )

Set the raw 64 bits of the header section of the block.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Encode<Ambiguous1> for T

§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _offset: usize, _depth: Depth ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
§

impl<T> Encode<Ambiguous2> for T

§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _offset: usize, _depth: Depth ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more