pub struct TypeTree {
pub nodes: Vec<TypeTreeNode>,
pub string_buffer: Vec<u8>,
pub version: u32,
pub platform: u32,
pub has_type_dependencies: bool,
}Expand description
Complete TypeTree structure
This structure contains the complete type information for a Unity object, including all field definitions and their relationships.
Fields§
§nodes: Vec<TypeTreeNode>Root nodes of the type tree
string_buffer: Vec<u8>String buffer for type and field names
version: u32Version of the type tree format
platform: u32Platform target
has_type_dependencies: boolWhether type tree has type dependencies
Implementations§
Source§impl TypeTree
impl TypeTree
Sourcepub fn with_capacity(capacity: usize) -> TypeTree
pub fn with_capacity(capacity: usize) -> TypeTree
Create a TypeTree with initial capacity
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Get the number of root nodes
Sourcepub fn add_node(&mut self, node: TypeTreeNode)
pub fn add_node(&mut self, node: TypeTreeNode)
Add a root node
Sourcepub fn find_node(&self, name: &str) -> Option<&TypeTreeNode>
pub fn find_node(&self, name: &str) -> Option<&TypeTreeNode>
Find a root node by name
Sourcepub fn find_node_mut(&mut self, name: &str) -> Option<&mut TypeTreeNode>
pub fn find_node_mut(&mut self, name: &str) -> Option<&mut TypeTreeNode>
Find a root node by name (mutable)
Sourcepub fn node_names(&self) -> Vec<&str>
pub fn node_names(&self) -> Vec<&str>
Get all root node names
Sourcepub fn name_peek_prefix(&self) -> Option<(usize, String)>
pub fn name_peek_prefix(&self) -> Option<(usize, String)>
Return the minimal root-child prefix length needed to read an object name field.
This is inspired by UnityPy’s peek_name() strategy: we parse only the first N root fields,
stopping at m_Name/name instead of reading the full object.
Sourcepub fn get_string(&self, offset: u32) -> Option<String>
pub fn get_string(&self, offset: u32) -> Option<String>
Get string from buffer at offset
Sourcepub fn add_string(&mut self, s: &str) -> u32
pub fn add_string(&mut self, s: &str) -> u32
Add string to buffer and return offset
Sourcepub fn statistics(&self) -> TypeTreeStatistics
pub fn statistics(&self) -> TypeTreeStatistics
Get TypeTree statistics
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TypeTree
impl<'de> Deserialize<'de> for TypeTree
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TypeTree, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TypeTree, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for TypeTree
impl Serialize for TypeTree
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for TypeTree
impl RefUnwindSafe for TypeTree
impl Send for TypeTree
impl Sync for TypeTree
impl Unpin for TypeTree
impl UnwindSafe for TypeTree
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
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>
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>
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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().