[][src]Module r_fairdist::counter

Abstract representation of a multi-dimensional resource counter.

Many applications of resource counters need to manage multiple different individual resources at the same time. Instead of replicating the entire resource-counter infrastructure for each resource, the counter is abstracted instead to allow for multi-dimensional resource counters.

The [Counter] trait represents a multi-dimensional resource counter, which can be indexed to access its individual slots. Each slot is represented by the [Scalar] trait, which describes the numerical operations that are allowed on this value.

Due to restrictions in the trait-system of rust, all individual slots on a counter must share the same type implementing [Scalar].

Traits

Counter

Multi-dimensional resource counter

Scalar

Scalar resource counter