pub struct TypeTreeSerializer<'a> { /* private fields */ }Expand description
TypeTree serializer
This struct provides methods for serializing and deserializing Unity objects using TypeTree structure information.
Implementations§
Source§impl<'a> TypeTreeSerializer<'a>
impl<'a> TypeTreeSerializer<'a>
Sourcepub fn new(tree: &'a TypeTree) -> TypeTreeSerializer<'a>
pub fn new(tree: &'a TypeTree) -> TypeTreeSerializer<'a>
Create a new serializer with a TypeTree
Sourcepub fn parse_object(
&self,
reader: &mut BinaryReader<'_>,
) -> Result<IndexMap<String, UnityValue>, BinaryError>
pub fn parse_object( &self, reader: &mut BinaryReader<'_>, ) -> Result<IndexMap<String, UnityValue>, BinaryError>
Parse object data using the TypeTree structure
pub fn parse_object_with_ref_types( &self, reader: &mut BinaryReader<'_>, ref_types: &'a [SerializedType], ) -> Result<IndexMap<String, UnityValue>, BinaryError>
pub fn parse_object_detailed( &self, reader: &mut BinaryReader<'_>, options: TypeTreeParseOptions, ) -> Result<TypeTreeParseOutput, BinaryError>
pub fn parse_object_detailed_with_ref_types( &self, reader: &mut BinaryReader<'_>, options: TypeTreeParseOptions, ref_types: &'a [SerializedType], ) -> Result<TypeTreeParseOutput, BinaryError>
Sourcepub fn parse_object_prefix_detailed(
&self,
reader: &mut BinaryReader<'_>,
options: TypeTreeParseOptions,
root_children: usize,
) -> Result<TypeTreeParseOutput, BinaryError>
pub fn parse_object_prefix_detailed( &self, reader: &mut BinaryReader<'_>, options: TypeTreeParseOptions, root_children: usize, ) -> Result<TypeTreeParseOutput, BinaryError>
Parse only the first root_children fields of the root node.
This enables UnityPy-like fast paths such as peek_name() where we only need a small prefix
of the TypeTree to reach m_Name.
pub fn parse_object_prefix_detailed_with_ref_types( &self, reader: &mut BinaryReader<'_>, options: TypeTreeParseOptions, root_children: usize, ref_types: &'a [SerializedType], ) -> Result<TypeTreeParseOutput, BinaryError>
Sourcepub fn scan_pptrs(
&self,
reader: &mut BinaryReader<'_>,
) -> Result<PPtrScanResult, BinaryError>
pub fn scan_pptrs( &self, reader: &mut BinaryReader<'_>, ) -> Result<PPtrScanResult, BinaryError>
Scan TypeTree-based object bytes and collect any encountered PPtr references without
allocating a full UnityValue tree.
Sourcepub fn scan_pptrs_with_ref_types(
&self,
reader: &mut BinaryReader<'_>,
ref_types: Option<&[SerializedType]>,
) -> Result<PPtrScanResult, BinaryError>
pub fn scan_pptrs_with_ref_types( &self, reader: &mut BinaryReader<'_>, ref_types: Option<&[SerializedType]>, ) -> Result<PPtrScanResult, BinaryError>
Scan TypeTree-based object bytes and collect any encountered PPtr references, using
file-level ref_types to best-effort traverse managed reference payloads.
Sourcepub fn serialize_object(
&self,
data: &IndexMap<String, UnityValue>,
) -> Result<Vec<u8>, BinaryError>
pub fn serialize_object( &self, data: &IndexMap<String, UnityValue>, ) -> Result<Vec<u8>, BinaryError>
Serialize object data using the TypeTree structure
Sourcepub fn estimate_size(&self, data: &IndexMap<String, UnityValue>) -> usize
pub fn estimate_size(&self, data: &IndexMap<String, UnityValue>) -> usize
Estimate serialized size
Auto Trait Implementations§
impl<'a> Freeze for TypeTreeSerializer<'a>
impl<'a> RefUnwindSafe for TypeTreeSerializer<'a>
impl<'a> Send for TypeTreeSerializer<'a>
impl<'a> Sync for TypeTreeSerializer<'a>
impl<'a> Unpin for TypeTreeSerializer<'a>
impl<'a> UnwindSafe for TypeTreeSerializer<'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> 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