pub trait Tree {
// Required methods
fn get_root_data(&self) -> &Data;
fn insert(&mut self, prefix: &[usize], data: &Data);
fn mode(&self) -> Mode;
fn set_mode(&mut self, mode: Mode);
fn set_root_data(&mut self, data: Data);
// Provided methods
fn from_json(
dhat_data: DhatData,
entry_point: &EntryPoint,
frames: &[Glob],
) -> Self
where Self: Sized + Default { ... }
fn insert_iter(&mut self, iter: impl Iterator<Item = ProgramPoint>) { ... }
fn metrics(&self) -> ToolMetrics { ... }
}
Available on crate feature
runner
only.Expand description
The trait to be implemented for a dhat prefix tree
Required Methods§
Sourcefn get_root_data(&self) -> &Data
fn get_root_data(&self) -> &Data
Return the Data
of the root
Sourcefn set_root_data(&mut self, data: Data)
fn set_root_data(&mut self, data: Data)
Set the Data
of the root
Provided Methods§
Sourcefn from_json(
dhat_data: DhatData,
entry_point: &EntryPoint,
frames: &[Glob],
) -> Self
fn from_json( dhat_data: DhatData, entry_point: &EntryPoint, frames: &[Glob], ) -> Self
Create a new Tree
from the given parameters
Sourcefn insert_iter(&mut self, iter: impl Iterator<Item = ProgramPoint>)
fn insert_iter(&mut self, iter: impl Iterator<Item = ProgramPoint>)
Insert all ProgramPoint
s into this Tree
Sourcefn metrics(&self) -> ToolMetrics
fn metrics(&self) -> ToolMetrics
Return the metrics of the root node
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.