pub struct TraceRegistry { /* private fields */ }Expand description
Registry of trace handlers with their associated filters.
Register handlers with filters, then dispatch traces. Only traces that match a handler’s filter will be forwarded to that handler.
Implementations§
Source§impl TraceRegistry
impl TraceRegistry
Sourcepub fn register(&mut self, handler: Arc<dyn TraceHandler>, filter: TraceFilter)
pub fn register(&mut self, handler: Arc<dyn TraceHandler>, filter: TraceFilter)
Register a trace handler with its filter.
Sourcepub async fn dispatch(
&self,
trace: &CallTrace,
ctx: &IndexContext,
) -> Result<(), IndexerError>
pub async fn dispatch( &self, trace: &CallTrace, ctx: &IndexContext, ) -> Result<(), IndexerError>
Dispatch a trace to all handlers whose filter matches.
Sourcepub async fn dispatch_batch(
&self,
traces: &[CallTrace],
ctx: &IndexContext,
) -> Result<(), IndexerError>
pub async fn dispatch_batch( &self, traces: &[CallTrace], ctx: &IndexContext, ) -> Result<(), IndexerError>
Dispatch a batch of traces to all matching handlers.
Sourcepub fn handler_count(&self) -> usize
pub fn handler_count(&self) -> usize
Returns the number of registered handlers.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TraceRegistry
impl !RefUnwindSafe for TraceRegistry
impl Send for TraceRegistry
impl Sync for TraceRegistry
impl Unpin for TraceRegistry
impl UnsafeUnpin for TraceRegistry
impl !UnwindSafe for TraceRegistry
Blanket Implementations§
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
Mutably borrows from an owned value. Read more