Skip to main content

BoundedInteger

Trait BoundedInteger 

Source
pub trait BoundedInteger:
    Sealed
    + Copy
    + PartialOrd {
    const ZERO: Self;
}
Expand description

Sealed marker for the closed-set typed-integer axes require_positive_bounded brackets: u32 (six existing call sites: MeshPolicy::retries, CircuitBreaker::max_failures, RateLimit::rate, SupervisorSpec::max_restarts, LimitsSpec::cpu) and u64 (one existing call site: LimitsSpec::fuel). Sealed via a private supertrait so a future impl from downstream crates is structurally impossible — the closed-set posture the peer crate::CaixaKind / crate::supervisor::RestartStrategy / crate::supervisor::RestartPolicy / crate::RateLimitUnit closed-set typed enums carry, extended onto the typed-integer primitive-axis surface. A future primitive-integer axis (a hypothetical u16 port-cap axis for :entrada :port, a hypothetical usize per-Aplicacao membership-cap axis, the M4 admission webhook’s per-request-count bounded axis) adds one [sealed_bounded_integer::Sealed] impl + one BoundedInteger::ZERO impl and picks up the shared three-arm gate by construction — the alternative is a per-primitive-type hand-authored require_positive_bounded_<T> sibling every future axis re-derives.

Carries a single associated const ZERO: Self the shared helper dispatches through on its zero-floor arm — routed through a primitive-level const rather than the free Default::default() projection, since Default::default() == 0 is a semantic accident of the integer primitives (nothing in the Default trait promises it) that a future non-integer BoundedInteger impl would silently break.

Required Associated Constants§

Source

const ZERO: Self

The additive identity for this axis — the zero-floor arm on require_positive_bounded compares value == Self::ZERO.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl BoundedInteger for u32

Source§

const ZERO: Self = 0

Source§

impl BoundedInteger for u64

Source§

const ZERO: Self = 0

Implementors§