Skip to main content

Container

Struct Container 

Source
pub struct Container { /* private fields */ }
Expand description

A file’s container, with the charge for its tables.

Implementations§

Source§

impl Container

Source

pub fn empty(meter: &Arc<Meter>) -> Self

No rows, no preload table.

Source

pub fn new( rows: MeteredVec<ContainerRow>, preload_table: Option<MeteredVec<Option<PPtr>>>, ) -> Result<Self, ChargeError>

The rows and preload table a read grew on the input’s meter. A table with spare capacity moves into an exact allocation that is charged first (MeteredVec::into_boxed_slice).

Source

pub fn with_preload_not_a_list( rows: MeteredVec<ContainerRow>, ) -> Result<Self, ChargeError>

The rows, with an m_PreloadTable that is not a list.

Source

pub fn rows(&self) -> &[ContainerRow]

Rows in file order.

Source

pub fn preload_table(&self) -> Result<Option<&[Option<PPtr>]>, Error>

m_PreloadTable, when the AssetBundle has one: Ok(None) without an AssetBundle, an error when it is not a list (UnityPy’s preload raises TypeError at its len(), helpers/ContainerHelper.py:38).

Source

pub fn charge(&self) -> &Charge

The charge for the tables.

Source

pub fn is_empty(&self) -> bool

Whether the file has no container rows.

Trait Implementations§

Source§

impl Debug for Container

Source§

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

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

impl Eq for Container

Source§

impl PartialEq for Container

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more

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
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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.