ProfilingExt

Trait ProfilingExt 

Source
pub trait ProfilingExt {
    // Required methods
    fn metrics(&self) -> &PerformanceMetrics;
    async fn publish_profiled<T: Message + Serialize>(
        &self,
        topic: &str,
        message: &T,
    ) -> Result<()>;
    async fn subscribe_profiled<T: Message + DeserializeOwned + Send + 'static>(
        &self,
        topic: &str,
    ) -> Result<Receiver<T>>;
}
Expand description

Extension trait for Context to add profiling

Required Methods§

Source

fn metrics(&self) -> &PerformanceMetrics

Get performance metrics

Source

async fn publish_profiled<T: Message + Serialize>( &self, topic: &str, message: &T, ) -> Result<()>

Publish with latency tracking

Source

async fn subscribe_profiled<T: Message + DeserializeOwned + Send + 'static>( &self, topic: &str, ) -> Result<Receiver<T>>

Subscribe with latency tracking

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§