Trait CounterRepr

Source
pub trait CounterRepr:
    Sealed
    + Default
    + Debug
    + TestOnlyPartialEq {
    // Required methods
    fn get(&self) -> u64;
    fn new(value: u64) -> Self;

    // Provided method
    fn into_repr<C: CounterRepr>(&self) -> C { ... }
}
Expand description

A marker trait to indicate types that may be used as a counter.

Required Methods§

Source

fn get(&self) -> u64

Get the held counter value.

Source

fn new(value: u64) -> Self

Construct a new counter from the value.

Provided Methods§

Source

fn into_repr<C: CounterRepr>(&self) -> C

Convert one CounterRepr into another CounterRepr.

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§