pub struct Variable { /* private fields */ }Expand description
Effectively an f64, but with an optional domain that the value must be on.
Implementations§
Source§impl 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.
Sourcepub fn change_domain(&mut self, dmn: Option<[f64; 2]>)
pub fn change_domain(&mut self, dmn: Option<[f64; 2]>)
Mutates the domain of a variable.
Trait Implementations§
impl StructuralPartialEq for Variable
Auto Trait Implementations§
impl Freeze for Variable
impl RefUnwindSafe for Variable
impl Send for Variable
impl Sync for Variable
impl Unpin for Variable
impl UnwindSafe for Variable
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