Skip to main content

File

Enum File 

Source
pub enum File {
    Serialized(Arc<SerializedFile>),
    Bundle(Arc<BundleFile>),
    Web(Arc<WebFile>),
    Raw(Arc<RawFile>),
}
Expand description

A parsed file.

Variants§

§

Serialized(Arc<SerializedFile>)

An AssetsFile that is not raw by the name rule.

§

Bundle(Arc<BundleFile>)

A bundle.

§

Web(Arc<WebFile>)

A WebFile.

§

Raw(Arc<RawFile>)

What UnityPy keeps as a reader: resources, name-rule files, zip entries.

Implementations§

Source§

impl File

Source

pub fn mark_changed(&self)

Mark a parsed file and its parents changed. Raw readers have no flag.

Source

pub fn is_changed(&self) -> bool

Whether this parsed file was marked changed.

Source§

impl File

Source

pub fn container_files(&self) -> &[FileSlot]

A container’s loaded ordered files dict, or an empty slice for a leaf. New resource writers are exposed by the container’s writeable_cabs.

Source

pub fn container_directory(&self) -> &[DirEntry]

All container rows in original order, including duplicate names.

Source

pub fn container_entry(&self, i: usize) -> Result<File, Error>

Parse a container row. Leaf files have no rows.

Source

pub fn child_container(&self, i: usize) -> Result<Option<Self>, Error>

Open a child container, leaving serialized and raw entries lazy. A leaf still occupies its directory position in a file walk. Probe read failures and resource refusals are returned.

Source

pub fn meter(&self) -> &Arc<Meter> ⓘ

The meter of the input this file belongs to.

Source

pub fn file_type(&self) -> FileType

What check_file_type called the bytes parse_file built this from, kept so a caller never detects them again (a gzip entry’s detection inflates it): each kind but a reader has one type, and a reader keeps its own (RawFile::file_type).

Trait Implementations§

Source§

impl Clone for File

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for File

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for File

§

impl !UnwindSafe for File

§

impl Forget for File

§

impl Freeze for File

§

impl Move for File

§

impl Send for File

§

impl Sync for File

§

impl Unpin for File

§

impl UnsafeUnpin for File

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

Source§

type Output = T

Should always be Self
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 = !

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.