Struct Table

Source
#[repr(C, align(16))]
pub struct Table { /* private fields */ }
Expand description

A table entry in the file format. Tables are 48 bytes in length when stored.

Implementations§

Source§

impl Table

Source

pub const SIZE: usize = 48usize

Size of the table entry.

Source

pub fn create() -> TableBuilder

Create a table using the builder.

Source

pub fn identifier(&self) -> Identifier

Get the table identifier.

Source

pub fn metadata_length(&self) -> u64

Get the metadata length.

Source

pub fn metadata_length_mut(&mut self) -> &mut u64

Get the metadata length mutably

Source

pub fn metadata_offset(&self) -> u64

Get the metadata offset in the file. This is an absolute offset within the file, i.e. zero based.

Source

pub fn metadata_offset_mut(&mut self) -> &mut u64

Get the metadata offset mutably.

Source

pub fn offset(&mut self, data_length: u64, chunk_count: u32)

Helper to collapse tables into parents.

Source

pub fn child_count(&self) -> u32

Get the child table count.

Source

pub fn sibling(&self) -> u32

Get the index offset from this entry to its sibling. Zero if there is no sibling.

Source

pub fn sibling_mut(&mut self) -> &mut u32

Get the sibling index mutably.

Source

pub fn chunk_index(&self) -> u32

Get the index of the first chunk owned by this table.

Source

pub fn chunk_count(&self) -> u32

Get the number of chunks owned by this table.

Source

pub fn read<E: ByteOrder>(reader: &mut dyn Read) -> Result<Self>

Read a table from the given stream.

Source

pub fn write<E: ByteOrder>(self, writer: &mut dyn Write) -> Result<()>

Write a table to the given stream.

Trait Implementations§

Source§

impl Clone for Table

Source§

fn clone(&self) -> Table

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Table

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Table

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Hash for Table

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Table

Source§

fn eq(&self, other: &Table) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Table

Source§

impl Eq for Table

Source§

impl StructuralPartialEq for Table

Auto Trait Implementations§

§

impl Freeze for Table

§

impl RefUnwindSafe for Table

§

impl Send for Table

§

impl Sync for Table

§

impl Unpin for Table

§

impl UnwindSafe for Table

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
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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>,

Source§

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.