pub struct RexxValue { /* private fields */ }Expand description
Every REXX value is a string. Numeric operations interpret the string content as a number when needed, and produce string results.
Implementations§
Source§impl RexxValue
impl RexxValue
pub fn new(s: impl Into<String>) -> Self
pub fn as_str(&self) -> &str
pub fn into_string(self) -> String
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn to_decimal(&self) -> Option<BigDecimal>
pub fn to_decimal(&self) -> Option<BigDecimal>
Attempt to interpret this value as a REXX number. REXX numbers can have leading/trailing blanks, optional sign, digits with an optional decimal point, and optional exponent.
Sourcepub fn is_whole_number(&self, digits: u32) -> bool
pub fn is_whole_number(&self, digits: u32) -> bool
REXX whole number check — a number with no fractional part within current NUMERIC DIGITS precision.
Sourcepub fn from_decimal(d: &BigDecimal, digits: u32, form: NumericForm) -> Self
pub fn from_decimal(d: &BigDecimal, digits: u32, form: NumericForm) -> Self
Format a BigDecimal according to REXX numeric formatting rules.
Respects NUMERIC DIGITS and NUMERIC FORM (SCIENTIFIC vs ENGINEERING).
Trait Implementations§
impl Eq for RexxValue
impl StructuralPartialEq for RexxValue
Auto Trait Implementations§
impl Freeze for RexxValue
impl RefUnwindSafe for RexxValue
impl Send for RexxValue
impl Sync for RexxValue
impl Unpin for RexxValue
impl UnsafeUnpin for RexxValue
impl UnwindSafe for RexxValue
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