[][src]Struct tracing_callgraph::GraphLayer

pub struct GraphLayer { /* fields omitted */ }

A Layer that records span open events as directed edges in a call graph.

Dropping and Flushing

To ensure all data is flushed when the program exits, GraphLayer exposes the [flush_on_drop] function, which returns a FlushGuard. The FlushGuard will flush the writer when it is dropped. If necessary, it can also be used to manually flush the writer.

Implementations

impl GraphLayer[src]

pub fn enable_top_node(self, name: &'static str) -> Self[src]

Add a top node to the graph.

pub fn disable_top_node(self) -> Self[src]

Remove the top node to the graph.

impl GraphLayer[src]

pub fn new() -> Self[src]

Returns a new GraphLayer which constructs the call graph.

pub fn flush_on_drop<W>(&self, writer: W) -> FlushGuard<W> where
    W: Write + 'static, 
[src]

Returns a FlushGuard which will flush the GraphLayer's writer when it is dropped, or when flush is manually invoked on the guard.

impl GraphLayer[src]

pub fn with_file(
    path: impl AsRef<Path>
) -> Result<(Self, FlushGuard<BufWriter<File>>), Error>
[src]

Constructs a GraphLayer that constructs the call graph, and a FlushGuard which writes the graph to a dot file when dropped.

Trait Implementations

impl Clone for GraphLayer[src]

impl Debug for GraphLayer[src]

impl Default for GraphLayer[src]

impl<S> Layer<S> for GraphLayer where
    S: Subscriber + for<'span> LookupSpan<'span>, 
[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.