Skip to main content

WebFile

Struct WebFile 

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

A WebFile.

Implementations§

Source§

impl WebFile

Source

pub fn get_writeable_cab( &self, name: Option<&RawStr>, ) -> Result<WriteableCab, SaveError>

Create or reuse a resource writer. Existing reader keys refuse. Creation alone neither marks changed nor registers an environment CAB.

Source

pub fn writeable_cabs(&self) -> Result<MeteredVec<WriteableCab>, SaveError>

The writers added after the loaded files, in dictionary order.

Source§

impl WebFile

Source

pub fn mark_changed(&self)

Mark this container and all its live parent containers changed.

Source

pub fn is_changed(&self) -> bool

Whether this container or one of its children was marked changed.

Source§

impl WebFile

Source

pub fn save(&self, options: WebSaveOptions) -> Result<Bytes, SaveError>

Rebuild the live ordered files dictionary. Duplicate input names retain their first position and last value. Children use their default packer. Saving leaves the source bytes and change flags intact.

Source

pub fn save_with_signature( &self, options: WebSaveOptions, signature: &str, ) -> Result<Bytes, SaveError>

Save with an explicit signature, matching UnityPy’s signature=. Semantic layout refuses signatures that the reader cannot round trip.

Source§

impl WebFile

Source

pub fn open( name: RawStr, data: Bytes, parent: Option<Parent>, meter: &Arc<Meter>, ctx: &Arc<FileContext>, ) -> Result<Arc<Self>, Error>

Opens a WebFile from bytes, inflating gzip or brotli under the input meter.

Source

pub fn constructor_position(&self) -> i128

Final cursor of the uncompressed constructor reader.

Source

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

Loaded files dict: first key position, last row value. Newly created resource writers are in Self::writeable_cabs and follow it on save.

Source

pub fn entry_bytes(&self, i: usize) -> Result<Bytes, Error>

The bytes read by the file’s own reader, with signed offsets and sizes.

Source

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

Detect and parse an entry once; nested files share this input’s meter.

Source

pub fn load_all(&self) -> Result<(), Error>

Eagerly load every row in directory order, including overwritten keys.

Source

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

The meter of the input it belongs to.

Source

pub fn name(&self) -> &RawStr

The name it was opened under.

Source

pub fn data(&self) -> &Bytes

Its decompressed bytes.

Source

pub fn parent(&self) -> Option<&Parent>

The container it is an entry of.

Source

pub fn context(&self) -> &Arc<FileContext> ⓘ

The context it was opened with.

Source

pub fn signature(&self) -> &RawStr

The signature.

Source

pub fn packer(&self) -> WebPacker

The packer.

Source

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

The directory (flags always None).

Trait Implementations§

Source§

impl Debug for WebFile

Source§

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

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

impl Drop for WebFile

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. 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.