Skip to main content

QlogOutput

Trait QlogOutput 

pub trait QlogOutput: Send + 'static {
    // Required methods
    fn begin(
        &mut self,
        info: &TraceInfo,
    ) -> impl Future<Output = Result<(), Error>> + Send;
    fn event(
        &mut self,
        event: &QlogEventView<'_>,
    ) -> impl Future<Output = Result<(), Error>> + Send;
    fn flush(&mut self) -> impl Future<Output = Result<(), Error>> + Send;

    // Provided method
    fn finish(&mut self) -> impl Future<Output = Result<(), Error>> + Send { ... }
}
Available on crate features quic and std only.
Expand description

Asynchronous storage, invoked by the recording task after event admission. Methods may wait for I/O. Synchronous computation and destruction must finish promptly. An error ends the recorder; partially written records are never retried automatically. One task owns the output exclusively; Send permits executor migration. Implementations remain concrete inside the task, without boxing a future per event.

Required Methods§

fn begin( &mut self, info: &TraceInfo, ) -> impl Future<Output = Result<(), Error>> + Send

Initialize output once, before processing events or flush requests.

fn event( &mut self, event: &QlogEventView<'_>, ) -> impl Future<Output = Result<(), Error>> + Send

Write one observation in admission order; an error terminates recording.

fn flush(&mut self) -> impl Future<Output = Result<(), Error>> + Send

Flush buffered output after all earlier admitted commands.

Provided Methods§

fn finish(&mut self) -> impl Future<Output = Result<(), Error>> + Send

Finalize output after draining accepted events. Defaults to flushing.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

§

impl<W, E> QlogOutput for EncodedWriter<W, E>
where W: AsyncWrite + Unpin + Send + 'static, E: QlogEncoder + 'static,