pub struct Bundle { /* private fields */ }Expand description
An open UnityFS bundle: its header, blocks and nodes, with the file kept open to read nodes by range.
Implementations§
Source§impl Bundle
impl Bundle
Sourcepub fn open(path: &Path) -> Result<Self>
pub fn open(path: &Path) -> Result<Self>
Open the bundle at path: read its header and block table and check that the sizes add up (the header’s size is
the file’s, the blocks end where the file does, every node lies in the blocks’ bytes). Reads nothing of the data.
Sourcepub fn from_source(path: &Path, source: Box<dyn BundleSource>) -> Result<Self>
pub fn from_source(path: &Path, source: Box<dyn BundleSource>) -> Result<Self>
As Bundle::open, on any seekable source (path only names it in errors).
Sourcepub fn header(&self) -> &BundleHeader
pub fn header(&self) -> &BundleHeader
The header as stored.
Sourcepub fn hash(&self) -> [u8; 16]
pub fn hash(&self) -> [u8; 16]
The 16 bytes at the start of the block table (nothing reads them).
Sourcepub fn nodes(&self) -> &[BundleNode]
pub fn nodes(&self) -> &[BundleNode]
The files in the bundle, in the order the directory lists them.
Sourcepub fn node(&self, path: &str) -> Option<&BundleNode>
pub fn node(&self, path: &str) -> Option<&BundleNode>
The node whose path is exactly path.
Sourcepub fn blocks(&self) -> impl ExactSizeIterator<Item = Block> + '_
pub fn blocks(&self) -> impl ExactSizeIterator<Item = Block> + '_
The blocks, in data order.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Bundle
impl RefUnwindSafe for Bundle
impl Send for Bundle
impl Sync for Bundle
impl Unpin for Bundle
impl UnsafeUnpin for Bundle
impl UnwindSafe for Bundle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more