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>
impl<W: Write> VisgraphDoc<W>
Sourcepub fn new(opts: VisgraphDocOptions, output: W) -> Self
pub fn new(opts: VisgraphDocOptions, output: W) -> Self
Creates a new Visgraph Doctor
Sourcepub fn into_inner(self) -> W
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>
impl<ArtCan: CanBase, BCan, W: Write> Doctor<ArtCan, BCan> for VisgraphDoc<W>
Source§fn resolve(&mut self, builder: &BuilderHandle<BCan>, used: &BuilderHandle<BCan>)
fn resolve(&mut self, builder: &BuilderHandle<BCan>, used: &BuilderHandle<BCan>)
Source§fn build(
&mut self,
builder: &BuilderHandle<BCan>,
artifact: &ArtifactHandle<ArtCan>,
)
fn build( &mut self, builder: &BuilderHandle<BCan>, artifact: &ArtifactHandle<ArtCan>, )
One
Builder builds its artifact. Read moreSource§fn invalidate(&mut self, _builder: &BuilderHandle<BCan>)
fn invalidate(&mut self, _builder: &BuilderHandle<BCan>)
The given
Builder is invalidate. Read moreAuto 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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more