pub struct DataMarkerExtractorRegistry { /* private fields */ }Expand description
Registry of marker extractors keyed by concrete message TypeId.
Registration happens before the capture tap is installed. Lookups use the concrete type behind
&dyn Any, so the hot path avoids trying every extractor.
Implementations§
Source§impl DataMarkerExtractorRegistry
impl DataMarkerExtractorRegistry
Sourcepub fn register<T: 'static>(&mut self, ex: Box<dyn DataMarkerExtractor>)
pub fn register<T: 'static>(&mut self, ex: Box<dyn DataMarkerExtractor>)
Registers ex as the marker extractor for T.
Replaces any previous extractor for T; callers should finish registration before sharing
the registry with the capture path.
Sourcepub fn default_registry(classes: &[DataClass]) -> Self
pub fn default_registry(classes: &[DataClass]) -> Self
Creates a registry containing builtin extractors for the enabled classes.
Sourcepub fn lookup(&self, msg: &dyn Any) -> Option<&dyn DataMarkerExtractor>
pub fn lookup(&self, msg: &dyn Any) -> Option<&dyn DataMarkerExtractor>
Returns the extractor registered for the concrete type behind msg.
Trait Implementations§
Source§impl Debug for DataMarkerExtractorRegistry
impl Debug for DataMarkerExtractorRegistry
Auto Trait Implementations§
impl !RefUnwindSafe for DataMarkerExtractorRegistry
impl !UnwindSafe for DataMarkerExtractorRegistry
impl Freeze for DataMarkerExtractorRegistry
impl Send for DataMarkerExtractorRegistry
impl Sync for DataMarkerExtractorRegistry
impl Unpin for DataMarkerExtractorRegistry
impl UnsafeUnpin for DataMarkerExtractorRegistry
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§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>
Converts
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>
Converts
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