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§
Sourcefn metrics(&self) -> &PerformanceMetrics
fn metrics(&self) -> &PerformanceMetrics
Get performance metrics
Sourceasync fn publish_profiled<T: Message + Serialize>(
&self,
topic: &str,
message: &T,
) -> Result<()>
async fn publish_profiled<T: Message + Serialize>( &self, topic: &str, message: &T, ) -> Result<()>
Publish with latency tracking
Sourceasync fn subscribe_profiled<T: Message + DeserializeOwned + Send + 'static>(
&self,
topic: &str,
) -> Result<Receiver<T>>
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.