pub trait LifecycleTap: Send + Sync {
// Required method
fn observe(&self, node: &NodeName, observation: &Observation);
}runtime only.Expand description
The OPEN observation seam: everything that happens to an item, offered to whoever asked.
The framework ships taps of its own and an app adds its own at launch; they compose, because multi-destination is the ruling rather than a fallback — a journal in the database, a tracing span and an app’s metric are three destinations for one event and none of them is the others’ transport.
Object-safe on purpose. A tap generic over the info type could observe exactly one node’s
vocabulary, which is strictly less than what an arrangement needs — hence Observation and
its downcast rather than a parameter here.
Send + Sync because a tap is shared by every resident, and residents are threads and tasks at
once. Nothing in the seam is async: an observation must never be able to backpressure the loop
that produced it, so a tap that writes to a store queues the write and returns.
Required Methods§
Sourcefn observe(&self, node: &NodeName, observation: &Observation)
fn observe(&self, node: &NodeName, observation: &Observation)
Observe observation, produced by the node named node.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl LifecycleTap for RecordingTap
impl LifecycleTap for Taps
impl LifecycleTap for TracingTap
tracing only.