pub struct BasicNumber { /* private fields */ }
Expand description
A Haystack Number, encapsulating a scalar value and an optional unit value. The unit is represented as a string. This does not represent Haystack scientific notation numbers.
Implementations§
Source§impl BasicNumber
impl BasicNumber
Sourcepub fn new(value: f64, unit: Option<String>) -> BasicNumber
pub fn new(value: f64, unit: Option<String>) -> BasicNumber
Create a new BasicNumber
. If present, the unit should
be a valid unit string from Project Haystack’s
unit database.
Sourcepub fn new_unitless(value: f64) -> BasicNumber
pub fn new_unitless(value: f64) -> BasicNumber
Create a new BasicNumber
with no unit.
Sourcepub fn to_axon_code(&self) -> String
pub fn to_axon_code(&self) -> String
Return a string containing Axon code representing this number.
Trait Implementations§
Source§impl Clone for BasicNumber
impl Clone for BasicNumber
Source§fn clone(&self) -> BasicNumber
fn clone(&self) -> BasicNumber
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for BasicNumber
impl Debug for BasicNumber
Source§impl Display for BasicNumber
impl Display for BasicNumber
Source§impl PartialEq for BasicNumber
impl PartialEq for BasicNumber
impl StructuralPartialEq for BasicNumber
Auto Trait Implementations§
impl Freeze for BasicNumber
impl RefUnwindSafe for BasicNumber
impl Send for BasicNumber
impl Sync for BasicNumber
impl Unpin for BasicNumber
impl UnwindSafe for BasicNumber
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