pub struct TypeTreeBuilder { /* private fields */ }Expand description
TypeTree builder
This struct provides methods for building TypeTree structures programmatically, including validation and optimization.
Implementations§
Source§impl TypeTreeBuilder
impl TypeTreeBuilder
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a builder with initial capacity
Sourcepub fn has_type_dependencies(self, has_deps: bool) -> Self
pub fn has_type_dependencies(self, has_deps: bool) -> Self
Set type dependencies flag
Sourcepub fn add_root_node(&mut self, node: TypeTreeNode) -> Result<&mut Self>
pub fn add_root_node(&mut self, node: TypeTreeNode) -> Result<&mut Self>
Add a root node
Sourcepub fn add_simple_node(
&mut self,
type_name: String,
name: String,
byte_size: i32,
level: i32,
) -> Result<&mut Self>
pub fn add_simple_node( &mut self, type_name: String, name: String, byte_size: i32, level: i32, ) -> Result<&mut Self>
Create and add a simple node
Sourcepub fn add_child_to_node(
&mut self,
parent_name: &str,
child: TypeTreeNode,
) -> Result<&mut Self>
pub fn add_child_to_node( &mut self, parent_name: &str, child: TypeTreeNode, ) -> Result<&mut Self>
Add a child node to an existing node
Sourcepub fn add_primitive_field(
&mut self,
parent_name: &str,
field_name: String,
type_name: &str,
) -> Result<&mut Self>
pub fn add_primitive_field( &mut self, parent_name: &str, field_name: String, type_name: &str, ) -> Result<&mut Self>
Build common primitive types
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TypeTreeBuilder
impl RefUnwindSafe for TypeTreeBuilder
impl Send for TypeTreeBuilder
impl Sync for TypeTreeBuilder
impl Unpin for TypeTreeBuilder
impl UnwindSafe for TypeTreeBuilder
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