pub trait Counter: 'static {
type Primitive: Num;
const ZERO: Self;
// Required methods
fn add_assign(&self, n: Self::Primitive);
fn sub_assign(&self, n: Self::Primitive);
fn fetch(&self) -> Self::Primitive;
}Expand description
A type suitable as a shared census counter.
Required Associated Constants§
Required Associated Types§
Required Methods§
Sourcefn add_assign(&self, n: Self::Primitive)
fn add_assign(&self, n: Self::Primitive)
Eventually increase the value of this counter by n.
Sourcefn sub_assign(&self, n: Self::Primitive)
fn sub_assign(&self, n: Self::Primitive)
Eventually decrease the value of this counter by n.
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.