pub struct TraceContext {
pub strings: Vec<String>,
pub types: Vec<TypeInfo>,
pub variable_names: Vec<String>,
}Expand description
Unified context for trace execution containing strings, types, and variable names
Fields§
§strings: Vec<String>Format strings and constant strings
types: Vec<TypeInfo>Complete DWARF type information for perfect formatting
variable_names: Vec<String>Variable names for debugging and display
Implementations§
Source§impl TraceContext
impl TraceContext
Sourcepub fn add_string(&mut self, s: String) -> u16
pub fn add_string(&mut self, s: String) -> u16
Add a string to the context and return its index
Sourcepub fn add_type(&mut self, type_info: TypeInfo) -> u16
pub fn add_type(&mut self, type_info: TypeInfo) -> u16
Add a type to the context and return its index
Sourcepub fn add_variable_name(&mut self, name: String) -> u16
pub fn add_variable_name(&mut self, name: String) -> u16
Add a variable name to the context and return its index
Sourcepub fn get_string(&self, index: u16) -> Option<&str>
pub fn get_string(&self, index: u16) -> Option<&str>
Get a string by index
Sourcepub fn get_variable_name(&self, index: u16) -> Option<&str>
pub fn get_variable_name(&self, index: u16) -> Option<&str>
Get a variable name by index
Sourcepub fn string_count(&self) -> usize
pub fn string_count(&self) -> usize
Get the number of strings in the context
Sourcepub fn type_count(&self) -> usize
pub fn type_count(&self) -> usize
Get the number of types in the context
Sourcepub fn variable_name_count(&self) -> usize
pub fn variable_name_count(&self) -> usize
Get the number of variable names in the context
Sourcepub fn estimated_memory_usage(&self) -> usize
pub fn estimated_memory_usage(&self) -> usize
Get total memory usage estimate in bytes
Trait Implementations§
Source§impl Clone for TraceContext
impl Clone for TraceContext
Source§fn clone(&self) -> TraceContext
fn clone(&self) -> TraceContext
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 Debug for TraceContext
impl Debug for TraceContext
Source§impl Default for TraceContext
impl Default for TraceContext
Source§impl<'de> Deserialize<'de> for TraceContext
impl<'de> Deserialize<'de> for TraceContext
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TraceContext
impl RefUnwindSafe for TraceContext
impl Send for TraceContext
impl Sync for TraceContext
impl Unpin for TraceContext
impl UnwindSafe for TraceContext
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