Skip to main content

TickClosure

Trait TickClosure 

Source
pub trait TickClosure {
    type Metrics: MetricsState;
}
Expand description

Base trait of the tick closure traits: names the MetricsState typestate of the context the closure expects, so that Dfir<Tick> can be parameterized by the closure alone.

On its own, this bound gives access to a Dfir’s metadata (Dfir::meta_graph, Dfir::metrics, …) but not to any runner. The tick closure traits form a small hierarchy; bound on the one that matches what you need to do with the graph:

Concrete closures ([TickClosureFn]) implement all of them. The type-erased wrappers implement only what their vtable carries, so that erasing a graph for one kind of runner does not instantiate the code for the other: [TickClosureErasedSync] is Sync-only, [TickClosureErasedAsync] is Async-only, and [TickClosureErased] is both.

Required Associated Types§

Source

type Metrics: MetricsState

Whether the context passed to this closure tracks metrics. See MetricsState.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§