Trait BookkeptQty

Source
trait BookkeptQty: BookkeepableQty + DefaultExtTake {
    // Required methods
    fn from_raw(q: Qty) -> Self;
    fn into_raw(self) -> Qty;
}
Expand description

Bookkept memory quantities

Each bookkept quantity implements this trait, and has a single field raw of type Qty.

Should be Implemented by #[derive_deftly(BookKept)] and for raw Qty.

§CORRECTNESS

All accesses to raw, or calls to from_raw or into_raw, should be made from transaction functions, which modify one or more bookkept quantities together, preserving the invariants.

raw may be accessed mutably by such functions, but a bookkept quantity type should be constructed only with from_raw and should not be moved out of.

Required Methods§

Source

fn from_raw(q: Qty) -> Self

Make a new bookkept quantity from a raw untracked Qty

Source

fn into_raw(self) -> Qty

Unwrap into 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§