[][src]Trait daab::diagnostics::Doctor

pub trait Doctor {
    fn resolve(&mut self, _builder: &BuilderHandle, _used: &BuilderHandle) { ... }
fn build(&mut self, _builder: &BuilderHandle, _artifact: &ArtifactHandle) { ... }
fn clear(&mut self) { ... }
fn invalidate(&mut self, _builder: &BuilderHandle) { ... } }

Debugger for the ArtifactCache.

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

The Doctor conducts diagnoses on the ArtifactCache, if it is passed with ArtifactCache::new_with_doctor(). The ArtifactCache will call the methods of this trait whenever the respective event happens. It will be supplied with relevant object(s), such as Builders and artifacts. For details on each event see the respective method.

Each method as a default implementation to ease implementing specialized Doctors which don't need all the events. Each default implementation just dose nothing, i.e. are no-ops.

Provided methods

fn resolve(&mut self, _builder: &BuilderHandle, _used: &BuilderHandle)

One Builder resolves another Builder.

This methods means that builder appearently depends on used.

fn build(&mut self, _builder: &BuilderHandle, _artifact: &ArtifactHandle)

One Builder builds its artifact.

This method is called each time builder is invoked to build its artifact. Notice, this function is only called when a fresh artifact is actually constructed, i.e. first time it is resolved or when it is resolved after a reset or invalidation.

fn clear(&mut self)

The entire cache is cleared.

fn invalidate(&mut self, _builder: &BuilderHandle)

The given Builder is invalidate.

This method is only called if invalidation is call directly with builder as its argument.

Notice: All dependants of builder are invalidated as well, but this function will not be called for the dependant invalidations. If deep invalidation tracking is desirable, the dependencies have to be tracked via the resolve call back.

Notice: This invalidation might result in clearing the entire cache, but clear will not be called in such a case.

Loading content...

Implementors

impl Doctor for NoopDoctor[src]

impl<W: Write> Doctor for TextualDoc<W>[src]

impl<W: Write> Doctor for VisgraphDoc<W>[src]

Loading content...