pub struct WebFile { /* private fields */ }Expand description
A WebFile.
Implementations§
Source§impl WebFile
impl WebFile
Sourcepub fn get_writeable_cab(
&self,
name: Option<&RawStr>,
) -> Result<WriteableCab, SaveError>
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.
Sourcepub fn writeable_cabs(&self) -> Result<MeteredVec<WriteableCab>, SaveError>
pub fn writeable_cabs(&self) -> Result<MeteredVec<WriteableCab>, SaveError>
The writers added after the loaded files, in dictionary order.
Source§impl WebFile
impl WebFile
Sourcepub fn mark_changed(&self)
pub fn mark_changed(&self)
Mark this container and all its live parent containers changed.
Sourcepub fn is_changed(&self) -> bool
pub fn is_changed(&self) -> bool
Whether this container or one of its children was marked changed.
Source§impl WebFile
impl WebFile
Sourcepub fn save(&self, options: WebSaveOptions) -> Result<Bytes, SaveError>
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.
Sourcepub fn save_with_signature(
&self,
options: WebSaveOptions,
signature: &str,
) -> Result<Bytes, SaveError>
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
impl WebFile
Sourcepub fn open(
name: RawStr,
data: Bytes,
parent: Option<Parent>,
meter: &Arc<Meter>,
ctx: &Arc<FileContext>,
) -> Result<Arc<Self>, Error>
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.
Sourcepub fn constructor_position(&self) -> i128
pub fn constructor_position(&self) -> i128
Final cursor of the uncompressed constructor reader.
Sourcepub fn files(&self) -> &[FileSlot]
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.
Sourcepub fn entry_bytes(&self, i: usize) -> Result<Bytes, Error>
pub fn entry_bytes(&self, i: usize) -> Result<Bytes, Error>
The bytes read by the file’s own reader, with signed offsets and sizes.
Sourcepub fn entry(&self, i: usize) -> Result<File, Error>
pub fn entry(&self, i: usize) -> Result<File, Error>
Detect and parse an entry once; nested files share this input’s meter.
Sourcepub fn load_all(&self) -> Result<(), Error>
pub fn load_all(&self) -> Result<(), Error>
Eagerly load every row in directory order, including overwritten keys.
Sourcepub fn context(&self) -> &Arc<FileContext> ⓘ
pub fn context(&self) -> &Arc<FileContext> ⓘ
The context it was opened with.