Struct QlogConfig
pub struct QlogConfig { /* private fields */ }quic and std only.Expand description
Configure a worker and destination. The default has no destination and records nothing.
Built-in output uses qlog main draft 14 / QUIC events draft 13 JSON text sequences.
See qlog for specification links and reader compatibility.
Supply an output for custom storage, or an EncodedWriter for a custom serializer.
Implementations§
§impl QlogConfig
impl QlogConfig
pub fn with_event_schemas(self, schemas: &'static [EventSchema]) -> QlogConfig
pub fn with_event_schemas(self, schemas: &'static [EventSchema]) -> QlogConfig
Event schemas recorded in addition to QUIC, such as HTTP/3; events of other
schemas are not recorded. Schemas must be unique, else start fails.
pub fn set_event_schemas(
&mut self,
schemas: &'static [EventSchema],
) -> &mut QlogConfig
pub fn set_event_schemas( &mut self, schemas: &'static [EventSchema], ) -> &mut QlogConfig
Event schemas recorded in addition to QUIC, such as HTTP/3; events of other
schemas are not recorded. Schemas must be unique, else start fails.
pub fn with_writer(
self,
writer: impl AsyncWrite + Unpin + Send + 'static,
) -> QlogConfig
pub fn with_writer( self, writer: impl AsyncWrite + Unpin + Send + 'static, ) -> QlogConfig
Asynchronous destination for JSON text sequences, buffered with an 8 KiB buffer.
Flush and shutdown drain the buffer. Use output with an EncodedWriter to
control buffering explicitly or use a custom encoder.
pub fn set_writer(
&mut self,
writer: impl AsyncWrite + Unpin + Send + 'static,
) -> &mut QlogConfig
pub fn set_writer( &mut self, writer: impl AsyncWrite + Unpin + Send + 'static, ) -> &mut QlogConfig
Asynchronous destination for JSON text sequences, buffered with an 8 KiB buffer.
Flush and shutdown drain the buffer. Use output with an EncodedWriter to
control buffering explicitly or use a custom encoder.
pub fn with_output(self, output: impl QlogOutput) -> QlogConfig
pub fn with_output(self, output: impl QlogOutput) -> QlogConfig
Custom asynchronous output, owned and invoked by the recording task.
pub fn set_output(&mut self, output: impl QlogOutput) -> &mut QlogConfig
pub fn set_output(&mut self, output: impl QlogOutput) -> &mut QlogConfig
Custom asynchronous output, owned and invoked by the recording task.
pub fn maybe_with_title(self, title: Option<ArcStr>) -> QlogConfig
pub fn maybe_with_title(self, title: Option<ArcStr>) -> QlogConfig
Trace label. Use Rama’s arcstr! for allocation-free static text.
pub fn maybe_set_title(&mut self, title: Option<ArcStr>) -> &mut QlogConfig
pub fn maybe_set_title(&mut self, title: Option<ArcStr>) -> &mut QlogConfig
Trace label. Use Rama’s arcstr! for allocation-free static text.
pub fn with_title(self, title: ArcStr) -> QlogConfig
pub fn with_title(self, title: ArcStr) -> QlogConfig
Trace label. Use Rama’s arcstr! for allocation-free static text.
pub fn set_title(&mut self, title: ArcStr) -> &mut QlogConfig
pub fn set_title(&mut self, title: ArcStr) -> &mut QlogConfig
Trace label. Use Rama’s arcstr! for allocation-free static text.
pub fn without_title(self) -> QlogConfig
pub fn without_title(self) -> QlogConfig
Trace label. Use Rama’s arcstr! for allocation-free static text.
pub fn unset_title(&mut self) -> &mut QlogConfig
pub fn unset_title(&mut self) -> &mut QlogConfig
Trace label. Use Rama’s arcstr! for allocation-free static text.
pub fn maybe_with_description(self, description: Option<ArcStr>) -> QlogConfig
pub fn maybe_with_description(self, description: Option<ArcStr>) -> QlogConfig
Optional trace context. Runtime text converts into shared ArcStr storage.
pub fn maybe_set_description(
&mut self,
description: Option<ArcStr>,
) -> &mut QlogConfig
pub fn maybe_set_description( &mut self, description: Option<ArcStr>, ) -> &mut QlogConfig
Optional trace context. Runtime text converts into shared ArcStr storage.
pub fn with_description(self, description: ArcStr) -> QlogConfig
pub fn with_description(self, description: ArcStr) -> QlogConfig
Optional trace context. Runtime text converts into shared ArcStr storage.
pub fn set_description(&mut self, description: ArcStr) -> &mut QlogConfig
pub fn set_description(&mut self, description: ArcStr) -> &mut QlogConfig
Optional trace context. Runtime text converts into shared ArcStr storage.
pub fn without_description(self) -> QlogConfig
pub fn without_description(self) -> QlogConfig
Optional trace context. Runtime text converts into shared ArcStr storage.
pub fn unset_description(&mut self) -> &mut QlogConfig
pub fn unset_description(&mut self) -> &mut QlogConfig
Optional trace context. Runtime text converts into shared ArcStr storage.
pub fn with_start_time(self, start_time: Instant) -> QlogConfig
pub fn with_start_time(self, start_time: Instant) -> QlogConfig
Monotonic reference point for event timestamps.
pub fn set_start_time(&mut self, start_time: Instant) -> &mut QlogConfig
pub fn set_start_time(&mut self, start_time: Instant) -> &mut QlogConfig
Monotonic reference point for event timestamps.
pub fn with_queue_limits(self, limits: QueueLimits) -> QlogConfig
pub fn with_queue_limits(self, limits: QueueLimits) -> QlogConfig
Configure bounded admission. Invalid limits are rejected by start.
pub fn set_queue_limits(&mut self, limits: QueueLimits) -> &mut QlogConfig
pub fn set_queue_limits(&mut self, limits: QueueLimits) -> &mut QlogConfig
Configure bounded admission. Invalid limits are rejected by start.
pub fn maybe_with_history(self, history: Option<HistoryConfig>) -> QlogConfig
pub fn maybe_with_history(self, history: Option<HistoryConfig>) -> QlogConfig
Retain recent history instead of writing each observation immediately.
pub fn maybe_set_history(
&mut self,
history: Option<HistoryConfig>,
) -> &mut QlogConfig
pub fn maybe_set_history( &mut self, history: Option<HistoryConfig>, ) -> &mut QlogConfig
Retain recent history instead of writing each observation immediately.
pub fn with_history(self, history: HistoryConfig) -> QlogConfig
pub fn with_history(self, history: HistoryConfig) -> QlogConfig
Retain recent history instead of writing each observation immediately.
pub fn set_history(&mut self, history: HistoryConfig) -> &mut QlogConfig
pub fn set_history(&mut self, history: HistoryConfig) -> &mut QlogConfig
Retain recent history instead of writing each observation immediately.
pub fn without_history(self) -> QlogConfig
pub fn without_history(self) -> QlogConfig
Retain recent history instead of writing each observation immediately.
pub fn unset_history(&mut self) -> &mut QlogConfig
pub fn unset_history(&mut self) -> &mut QlogConfig
Retain recent history instead of writing each observation immediately.
pub fn with_enabled(self, enabled: bool) -> QlogConfig
pub fn with_enabled(self, enabled: bool) -> QlogConfig
Initial recording gate. A disabled recorder still initializes its destination.
pub fn set_enabled(&mut self, enabled: bool) -> &mut QlogConfig
pub fn set_enabled(&mut self, enabled: bool) -> &mut QlogConfig
Initial recording gate. A disabled recorder still initializes its destination.
pub fn with_scope(self, scope: impl Into<WeakScope>) -> QlogConfig
pub fn with_scope(self, scope: impl Into<WeakScope>) -> QlogConfig
Scope for the recording task. Its graceful phase closes admission, then waits for accepted events and output finalization, including writer shutdown.
pub fn set_scope(&mut self, scope: impl Into<WeakScope>) -> &mut QlogConfig
pub fn set_scope(&mut self, scope: impl Into<WeakScope>) -> &mut QlogConfig
Scope for the recording task. Its graceful phase closes admission, then waits for accepted events and output finalization, including writer shutdown.
pub fn with_error_sink(self, error_sink: impl ErrorSink) -> QlogConfig
pub fn with_error_sink(self, error_sink: impl ErrorSink) -> QlogConfig
Observe the first terminal output or recording-task failure, including graceful
shutdown and runtime cancellation. Defaults to TracingErrorSink::default.
The sink receives a rama_core::error::BoxError retaining the original cause.
It runs outside recorder locks and must return promptly; offload slow work.
Sink panics are isolated. Explicit flush and shutdown still return the failure.
pub fn set_error_sink(&mut self, error_sink: impl ErrorSink) -> &mut QlogConfig
pub fn set_error_sink(&mut self, error_sink: impl ErrorSink) -> &mut QlogConfig
Observe the first terminal output or recording-task failure, including graceful
shutdown and runtime cancellation. Defaults to TracingErrorSink::default.
The sink receives a rama_core::error::BoxError retaining the original cause.
It runs outside recorder locks and must return promptly; offload slow work.
Sink panics are isolated. Explicit flush and shutdown still return the failure.
pub fn start(self) -> Result<QlogRecorder, Error>
pub fn start(self) -> Result<QlogRecorder, Error>
Start a task on the current Rama/Tokio runtime. Await flush to observe destination
initialization. Submitting observations afterwards requires no runtime on the caller.
Trait Implementations§
§impl Default for QlogConfig
impl Default for QlogConfig
§fn default() -> QlogConfig
fn default() -> QlogConfig
Auto Trait Implementations§
impl !RefUnwindSafe for QlogConfig
impl !Sync for QlogConfig
impl !UnwindSafe for QlogConfig
impl Forget for QlogConfig
impl Freeze for QlogConfigwhere
*const dyn OutputFactory is !null: Freeze,
PhantomData<dyn OutputFactory>: Freeze,
*const ThinInner is !null: Freeze,
&'static [EventSchema]: Freeze,
*const ArcInner<Node> is !null: Freeze,
PhantomData<ArcInner<Node>>: Freeze,
*const ArcInner<Composite> is !null: Freeze,
PhantomData<ArcInner<Composite>>: Freeze,
*const ArcInner<dyn ErrorSink> is !null: Freeze,
PhantomData<ArcInner<dyn ErrorSink>>: Freeze,
impl Move for QlogConfig
impl Send for QlogConfig
impl Unpin for QlogConfig
impl UnsafeUnpin for QlogConfigwhere
*const dyn OutputFactory is !null: UnsafeUnpin,
PhantomData<dyn OutputFactory>: UnsafeUnpin,
*const ThinInner is !null: UnsafeUnpin,
&'static [EventSchema]: UnsafeUnpin,
*const ArcInner<Node> is !null: UnsafeUnpin,
PhantomData<ArcInner<Node>>: UnsafeUnpin,
*const ArcInner<Composite> is !null: UnsafeUnpin,
PhantomData<ArcInner<Composite>>: UnsafeUnpin,
*const ArcInner<dyn ErrorSink> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn ErrorSink>>: UnsafeUnpin,
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more