Trait Metrics

Source
pub trait Metrics<Out, In>:
    Clone
    + Send
    + 'static {
    // Required methods
    fn bytes_sent(&mut self, len: usize);
    fn bytes_received(&mut self, len: usize);
    fn message_sent(&mut self, msg: &Out);
    fn message_received(&mut self, msg: &In);
}
Expand description

A trait for types that observe connection metric events.

Required Methods§

Source

fn bytes_sent(&mut self, len: usize)

Callback reporting numbers of bytes sent.

Source

fn bytes_received(&mut self, len: usize)

Callback reporting numbers of bytes received.

Source

fn message_sent(&mut self, msg: &Out)

Callback reporting messages sent.

Source

fn message_received(&mut self, msg: &In)

Callback reporting messages received.

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§

Source§

impl<C, R> Metrics<C, R> for PerGrpcServerMetrics

Source§

impl<Out, In> Metrics<Out, In> for NoopMetrics