VisgraphDoc

Struct VisgraphDoc 

Source
pub struct VisgraphDoc<W: Write> { /* private fields */ }
Available on crate feature diagnostics only.
Expand description

Debugger outputting Visgraph dot file.

Notice: This struct is only available if the diagnostics feature has been activated.

The Visgraph Doctor generates a DOT graph about the dependencies of the builders and generated artifacts.

§Example

use std::fs::File;
use daab::rc::Cache;
use daab::diagnostics::{VisgraphDoc, VisgraphDocOptions};

let mut cache = Cache::new_with_doctor(
    VisgraphDoc::new(
        VisgraphDocOptions {
            show_builder_values: false,
            show_artifact_values: true,
        },
        File::create("test-graph.dot").unwrap()
    )
);

//...

Example output in DOT format:

strict digraph { graph [labeljust = l];
  "0x7faf30003960" [label = "alloc::rc::Rc<daab::test::BuilderSimpleNode>"]
  "0x7faf30005090" [label = "alloc::rc::Rc<daab::test::BuilderLeaf>"]
  "0x7faf30003960" -> "0x7faf30005090"
  "0x7faf30005090" [label = "alloc::rc::Rc<daab::test::BuilderLeaf>"]
  "0.0-0x7faf30015710" [label = "#0.0 daab::test::Leaf :
Leaf {
    id: 0,
}", shape = box]
  "0x7faf30005090" -> "0.0-0x7faf30015710" [arrowhead = "none"]
}

Implementations§

Source§

impl<W: Write> VisgraphDoc<W>

Source

pub fn new(opts: VisgraphDocOptions, output: W) -> Self

Creates a new Visgraph Doctor

Source

pub fn into_inner(self) -> W

Dismantles this struct and returns the inner Write.

Trait Implementations§

Source§

impl<ArtCan: CanBase, BCan, W: Write> Doctor<ArtCan, BCan> for VisgraphDoc<W>

Source§

fn resolve(&mut self, builder: &BuilderHandle<BCan>, used: &BuilderHandle<BCan>)

One Builder resolves another Builder. Read more
Source§

fn build( &mut self, builder: &BuilderHandle<BCan>, artifact: &ArtifactHandle<ArtCan>, )

One Builder builds its artifact. Read more
Source§

fn clear(&mut self)

The entire cache is cleared via ArtifactCache::clear().
Source§

fn invalidate(&mut self, _builder: &BuilderHandle<BCan>)

The given Builder is invalidate. Read more
Source§

impl<W: Write> Drop for VisgraphDoc<W>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<W> Freeze for VisgraphDoc<W>
where W: Freeze,

§

impl<W> RefUnwindSafe for VisgraphDoc<W>
where W: RefUnwindSafe,

§

impl<W> Send for VisgraphDoc<W>
where W: Send,

§

impl<W> Sync for VisgraphDoc<W>
where W: Sync,

§

impl<W> Unpin for VisgraphDoc<W>
where W: Unpin,

§

impl<W> UnwindSafe for VisgraphDoc<W>
where W: UnwindSafe,

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.