Trait BookkeepableQty

Source
pub(super) trait BookkeepableQty: Default {
    const ZERO: Self;

    // Required method
    fn as_raw(&self) -> Qty;
}
Expand description

Memory quantities that can work with bookkept quantities

This trait doesn’t imply any invariants; it merely provides read-only access to the underlying value, and ways to make a zero.

Used by the derived PartialEq and PartialOrd impls on bookkept quantities.

Implemented by hand for Qty.

Implemented for bookkept types, along with BookkeptQty, by #[derive_deftly(BookKept)].

Required Associated Constants§

Source

const ZERO: Self

Zero (default value)

Required Methods§

Source

fn as_raw(&self) -> Qty

Inspect as a raw untracked Qty

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§