pub trait CounterCollection:
Debug
+ Default
+ TestOnlyPartialEq {
type Spec: CounterCollectionSpec<CounterCollection<Self::Repr> = Self>;
type Repr: CounterRepr;
// Provided method
fn cast<C: CounterRepr>(
&self,
) -> <Self::Spec as CounterCollectionSpec>::CounterCollection<C> { ... }
}
Expand description
A collection of counters.
Required Associated Types§
Sourcetype Spec: CounterCollectionSpec<CounterCollection<Self::Repr> = Self>
type Spec: CounterCollectionSpec<CounterCollection<Self::Repr> = Self>
The CounterCollectionSpec
associated with this collection.
Sourcetype Repr: CounterRepr
type Repr: CounterRepr
The counter representation held by this collection.
Provided Methods§
Sourcefn cast<C: CounterRepr>(
&self,
) -> <Self::Spec as CounterCollectionSpec>::CounterCollection<C>
fn cast<C: CounterRepr>( &self, ) -> <Self::Spec as CounterCollectionSpec>::CounterCollection<C>
A utility method to cast this collection of counters into a different underlying counter representation.
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.