pub struct Bundle {
pub toc_path: String,
pub name: String,
pub manifest: Manifest,
/* private fields */
}Expand description
A bundle opened: its TOC’s tables, its file table and its manifest.
Fields§
§toc_path: StringPath of the superbundle TOC the bundle was found in, relative to the data folder.
name: StringThe bundle’s name as the TOC states it.
manifest: ManifestThe bundle’s binary manifest, with the sizes, hashes and names of its assets.
Implementations§
Source§impl Bundle
impl Bundle
Sourcepub fn entries(&self) -> impl Iterator<Item = Listed> + '_
pub fn entries(&self) -> impl Iterator<Item = Listed> + '_
Every entry: the EBX documents, then the resources, then the chunks, each in manifest order.
Sourcepub fn ebx(&self, i: usize) -> Option<Listed>
pub fn ebx(&self, i: usize) -> Option<Listed>
EBX document i of the manifest, as an entry; None when the manifest has no document i.
Sourcepub fn resource(&self, i: usize) -> Option<Listed>
pub fn resource(&self, i: usize) -> Option<Listed>
Resource i of the manifest, as an entry; None when the manifest has no resource i.
Sourcepub fn toc_chunk(
&self,
src: &Source<'_>,
guid: &[u8; 16],
) -> Result<Option<(FileRef, usize)>>
pub fn toc_chunk( &self, src: &Source<'_>, guid: &[u8; 16], ) -> Result<Option<(FileRef, usize)>>
The chunk with GUID guid in this bundle’s TOC chunk table: its bytes’ place and decoded size (the whole chunk:
a bundle’s manifest may hold a tail of it, as for a streamed texture), None when the table has none; an
error when the table lists it as removed.
Sourcepub fn chunk(
&self,
src: &Source<'_>,
guid: &[u8; 16],
) -> Result<(FileRef, usize)>
pub fn chunk( &self, src: &Source<'_>, guid: &[u8; 16], ) -> Result<(FileRef, usize)>
The chunk with GUID guid (as stored): its bytes’ place and decoded size, from this bundle or else from the
TOC’s chunk table (content copied from the base game lies there). From the bundle it is the range the manifest
stores (lsize bytes, which begin loff bytes into the whole chunk: Bundle::toc_chunk gives the whole).