Skip to main content

InputCounter

Trait InputCounter 

pub trait InputCounter:
    Clone
    + Send
    + Sync
    + 'static {
    type Tracker: InputCounterTracker;

    // Required methods
    fn increment(&self) -> Self::Tracker;
    fn decrement(&self);
}
Expand description

A counter used by CountInput to track total and concurrent inputs.

Contract:

  • increment is called exactly once per input and returns the tracker inserted into extensions
  • decrement is called exactly once when the input is finished

Required Associated Types§

type Tracker: InputCounterTracker

Tracker that will be inserted into the input extensions.

Required Methods§

fn increment(&self) -> Self::Tracker

Registers a new in flight input and returns a tracker for that input.

fn decrement(&self)

Marks the end of an in flight input.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§