pub trait Callback: Send {
type Output: Send;
// Required method
fn call(&mut self, instr: &Instrument, event: &Event) -> Self::Output;
}Expand description
Defines the ability for being passed to Instrument::install_handler
Send is required on both the callback and its output because visa invokes handlers
on its own thread and the output is delivered to the installing thread through a
channel – neither crosses that boundary safely otherwise.
Required Associated Types§
Required Methods§
fn call(&mut self, instr: &Instrument, event: &Event) -> Self::Output
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".