pub struct ObjectHandle<'a> { /* private fields */ }Expand description
A lightweight reference to a binary object within a SerializedFile.
This is conceptually similar to UnityPy’s ObjectReader: it carries just enough context
(file + object metadata) to parse the object on-demand.
Implementations§
Source§impl<'a> ObjectHandle<'a>
impl<'a> ObjectHandle<'a>
pub fn new(file: &'a SerializedFile, info: &'a ObjectInfo) -> ObjectHandle<'a>
pub fn file(&self) -> &'a SerializedFile
pub fn info(&self) -> &'a ObjectInfo
pub fn path_id(&self) -> i64
pub fn class_id(&self) -> i32
pub fn byte_start(&self) -> u64
pub fn byte_size(&self) -> u32
Sourcepub fn raw_data(&self) -> Result<&'a [u8], BinaryError>
pub fn raw_data(&self) -> Result<&'a [u8], BinaryError>
Get the raw bytes for this object (preloaded if available, otherwise sliced from the file).
Sourcepub fn read(&self) -> Result<UnityObject, BinaryError>
pub fn read(&self) -> Result<UnityObject, BinaryError>
Parse this object into an owned UnityObject (best-effort).
pub fn read_with_options( &self, options: TypeTreeParseOptions, ) -> Result<UnityObject, BinaryError>
Sourcepub fn peek_name(&self) -> Result<Option<String>, BinaryError>
pub fn peek_name(&self) -> Result<Option<String>, BinaryError>
Peek the object’s name (m_Name/name) without parsing the full TypeTree.
This mirrors UnityPy’s ObjectReader.peek_name() behavior by parsing only a prefix of the
root TypeTree until the name field, when possible.
pub fn peek_name_with_options( &self, options: TypeTreeParseOptions, ) -> Result<Option<String>, BinaryError>
Sourcepub fn scan_pptrs(&self) -> Result<Option<PPtrScanResult>, BinaryError>
pub fn scan_pptrs(&self) -> Result<Option<PPtrScanResult>, BinaryError>
Scan TypeTree-based object bytes and collect PPtr references (fileID, pathID) without
allocating a full parsed UnityValue tree.
Trait Implementations§
Source§impl<'a> Clone for ObjectHandle<'a>
impl<'a> Clone for ObjectHandle<'a>
Source§fn clone(&self) -> ObjectHandle<'a>
fn clone(&self) -> ObjectHandle<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for ObjectHandle<'a>
impl<'a> Debug for ObjectHandle<'a>
impl<'a> Copy for ObjectHandle<'a>
Auto Trait Implementations§
impl<'a> Freeze for ObjectHandle<'a>
impl<'a> !RefUnwindSafe for ObjectHandle<'a>
impl<'a> Send for ObjectHandle<'a>
impl<'a> Sync for ObjectHandle<'a>
impl<'a> Unpin for ObjectHandle<'a>
impl<'a> !UnwindSafe for ObjectHandle<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more