Struct BrowserMirGraphBuilder

Source
struct BrowserMirGraphBuilder<'a> {
    program: &'a MirProgram,
    program_names: ProgramNames,
    next_synthetic_id: usize,
    next_edge_id: usize,
    nodes: Vec<BrowserMirNode>,
    edges: Vec<BrowserMirEdge>,
}

Fields§

§program: &'a MirProgram§program_names: ProgramNames§next_synthetic_id: usize§next_edge_id: usize§nodes: Vec<BrowserMirNode>§edges: Vec<BrowserMirEdge>

Implementations§

Source§

impl<'a> BrowserMirGraphBuilder<'a>

Source

pub(super) fn new(program: &'a MirProgram) -> Self

Create a browser graph builder for one MIR program.

Source

pub(super) fn emit_program(&mut self) -> String

Emit the full MIR program graph and return the root node id.

Source

fn emit_function( &mut self, program_id: &str, func_id: MirFuncId, function: &MirFunction, )

Emit one MIR function subgraph.

Source

fn emit_block( &mut self, func_id: MirFuncId, function: &MirFunction, block_index: usize, block: &MirBlock, function_names: &FunctionNames, ) -> String

Emit one MIR block node.

Source§

impl<'a> BrowserMirGraphBuilder<'a>

Source

pub(super) fn node( &mut self, id: String, kind: &str, summary: Option<String>, category: &'static str, details: Vec<String>, ) -> String

Insert one graph node and return its id.

Source

pub(super) fn append_detail(&mut self, node_id: &str, detail: String)

Append one detail line to an existing graph node.

Source

pub(super) fn synthetic_node( &mut self, prefix: &str, kind: &str, summary: Option<String>, category: &'static str, details: Vec<String>, ) -> String

Insert one synthetic graph node with a generated id.

Source

pub(super) fn edge( &mut self, source: &str, target: &str, label: Option<&str>, category: &'static str, )

Insert one directed graph edge.

Trait Implementations§

Source§

impl<'a> Debug for BrowserMirGraphBuilder<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.