Struct Scales
pub struct Scales {
by_kind: [Option<Scale>; 7],
}Expand description
A caller’s default scale per QuantityKind — what a book reports an
unscaled measure in.
A value, not a setting: a book carries one, and two books with different scales report side by side in one process.
Fields§
§by_kind: [Option<Scale>; 7]Implementations§
§impl Scales
impl Scales
pub fn new() -> Self
pub fn new() -> Self
No defaults: every kind falls through to the measure’s own.
pub fn with(self, kind: QuantityKind, scale: Scale) -> Self
pub fn with(self, kind: QuantityKind, scale: Scale) -> Self
These defaults, with kind reported in scale.
pub fn get(&self, kind: QuantityKind) -> Option<Scale>
pub fn get(&self, kind: QuantityKind) -> Option<Scale>
The default for kind, if one was stated.
fn slot(kind: QuantityKind) -> usize
Trait Implementations§
impl Copy for Scales
impl Eq for Scales
impl StructuralPartialEq for Scales
Auto Trait Implementations§
impl Freeze for Scales
impl RefUnwindSafe for Scales
impl Send for Scales
impl Sync for Scales
impl Unpin for Scales
impl UnsafeUnpin for Scales
impl UnwindSafe for Scales
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more