Skip to main content

IdentityExtractor

Trait IdentityExtractor 

Source
pub trait IdentityExtractor: Send + Sync {
    // Required method
    fn extract(&self, message: &dyn Any) -> Option<UUID4>;
}
Expand description

Extracts the logical message identity (event id, command id) from a captured message.

The adapter uses the identity to capture a message exactly once when dispatch pushes it through multiple tap-visible boundaries. Types without an extractor are captured per dispatch, which is correct only for types that reach the tap on a single boundary.

Required Methods§

Source

fn extract(&self, message: &dyn Any) -> Option<UUID4>

Returns the identity carried by message. Mismatched types yield None so a stale registration cannot crash the tap.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<T: 'static, F> IdentityExtractor for TypedIdentityExtractor<T, F>
where F: Fn(&T) -> Option<UUID4> + Send + Sync,