Trait QlogEncoder
pub trait QlogEncoder: Send {
// Required methods
fn begin<W>(
&mut self,
info: &TraceInfo,
output: &mut W,
) -> impl Future<Output = Result<(), Error>> + Send
where W: AsyncWrite + Unpin + Send;
fn named_event<W>(
&mut self,
info: &TraceInfo,
event: &NamedQlogEventView<'_>,
output: &mut W,
) -> impl Future<Output = Result<(), Error>> + Send
where W: AsyncWrite + Unpin + Send;
fn event<W>(
&mut self,
info: &TraceInfo,
event: &QlogEventView<'_>,
output: &mut W,
) -> impl Future<Output = Result<(), Error>> + Send
where W: AsyncWrite + Unpin + Send;
// Provided method
fn finish<W>(
&mut self,
_output: &mut W,
) -> impl Future<Output = Result<(), Error>> + Send
where W: AsyncWrite + Unpin + Send { ... }
}Available on crate features
quic and std only.Expand description
Streaming asynchronous serialization of borrowed events to caller-provided output. Encoders can suspend at I/O backpressure without blocking an executor thread.
Required Methods§
fn begin<W>(
&mut self,
info: &TraceInfo,
output: &mut W,
) -> impl Future<Output = Result<(), Error>> + Send
fn begin<W>( &mut self, info: &TraceInfo, output: &mut W, ) -> impl Future<Output = Result<(), Error>> + Send
Write trace metadata before the first event.
fn named_event<W>(
&mut self,
info: &TraceInfo,
event: &NamedQlogEventView<'_>,
output: &mut W,
) -> impl Future<Output = Result<(), Error>> + Send
fn named_event<W>( &mut self, info: &TraceInfo, event: &NamedQlogEventView<'_>, output: &mut W, ) -> impl Future<Output = Result<(), Error>> + Send
Write one named event, whose data is an already encoded JSON object.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".