pub struct TypeTreePackage { /* private fields */ }Expand description
A parsed type tree package.
Implementations§
Source§impl TypeTreePackage
impl TypeTreePackage
Sourcepub fn parse(bytes: &[u8]) -> Result<Self>
pub fn parse(bytes: &[u8]) -> Result<Self>
Parse a type tree package (TPK format 1 or 2, uncompressed or LZ4). Every index in it is checked, the size an
LZ4 block claims is checked against what LZ4 can inflate to before anything is allocated for it, and a package
that is LZMA- or Brotli-compressed is refused as crate::Error::Unsupported.
Sourcepub fn common_strings(&self, version: UnityVersion) -> Option<CommonStrings<'_>>
pub fn common_strings(&self, version: UnityVersion) -> Option<CommonStrings<'_>>
The common string table of a Unity version: the table of the newest listed version that is not newer than
version. None for a package that lists none up to that version.
Sourcepub fn class_name(&self, class_id: i32, version: UnityVersion) -> Option<&str>
pub fn class_name(&self, class_id: i32, version: UnityVersion) -> Option<&str>
The class’s name in that Unity version.
Trait Implementations§
Source§impl Clone for TypeTreePackage
impl Clone for TypeTreePackage
Auto Trait Implementations§
impl Freeze for TypeTreePackage
impl RefUnwindSafe for TypeTreePackage
impl Send for TypeTreePackage
impl Sync for TypeTreePackage
impl Unpin for TypeTreePackage
impl UnsafeUnpin for TypeTreePackage
impl UnwindSafe for TypeTreePackage
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