Trait Tree

Source
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§

Source

fn get_root_data(&self) -> &Data

Return the Data of the root

Source

fn insert(&mut self, prefix: &[usize], data: &Data)

Insert a prefix with the given Data into this Tree

Source

fn mode(&self) -> Mode

Return the dhat invocation Mode

Source

fn set_mode(&mut self, mode: Mode)

Set the dhat invocation Mode

Source

fn set_root_data(&mut self, data: Data)

Set the Data of the root

Provided Methods§

Source

fn from_json( dhat_data: DhatData, entry_point: &EntryPoint, frames: &[Glob], ) -> Self
where Self: Sized + Default,

Create a new Tree from the given parameters

Source

fn insert_iter(&mut self, iter: impl Iterator<Item = ProgramPoint>)

Insert all ProgramPoints into this Tree

Source

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.

Implementors§