pub struct Meter {
pub current: i32,
pub max: i32,
}Available on crate feature
unstable only.Expand description
A value with its maximum, such as health.
The name is enshwick’s: one attribute’s current and maximum value.
§Examples
use enshwick::world::Meter;
let health = Meter { current: 150, max: 200 };
assert_eq!(health.fraction(), 0.75);Fields§
§current: i32The value now.
max: i32The most it holds now, buffs and gear included.
Implementations§
Trait Implementations§
impl Copy for Meter
impl Eq for Meter
impl StructuralPartialEq for Meter
Auto Trait Implementations§
impl Freeze for Meter
impl RefUnwindSafe for Meter
impl Send for Meter
impl Sync for Meter
impl Unpin for Meter
impl UnsafeUnpin for Meter
impl UnwindSafe for Meter
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