Struct nexsys_core::mvcalc::Variable
source · pub struct Variable { /* private fields */ }Expand description
Effectively an f64, but with an optional domain that the value must be on.
Implementations
sourceimpl Variable
impl Variable
sourcepub fn new(value: f64, domain: Option<[f64; 2]>) -> Variable
pub fn new(value: f64, domain: Option<[f64; 2]>) -> Variable
Instantiates a new Variable struct with a specified value and domain.
sourcepub fn change(&mut self, qty: f64)
pub fn change(&mut self, qty: f64)
Allows the ability to mutate self.value if the new value is on self.domain.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Variable
impl Send for Variable
impl Sync for Variable
impl Unpin for Variable
impl UnwindSafe for Variable
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more