Skip to main content

MayFlush

Trait MayFlush 

Source
pub trait MayFlush: LocalMetric {
    // Required method
    fn may_flush(&self);

    // Provided method
    fn try_flush(&self, last_flush: &Cell<u64>, flush_interval_millis: u64) { ... }
}
Expand description

An interface models a LocalMetric with try to flush functions. Not intend to be implemented by user manually, used in macro generated code.

Required Methods§

Source

fn may_flush(&self)

Open to implementation to fill try_flush parameters

Provided Methods§

Source

fn try_flush(&self, last_flush: &Cell<u64>, flush_interval_millis: u64)

If the LocalMetric is already flushed in last flush_interval_sec seconds, then do nothing, else flush and update last flush time.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§