pub struct SmartCalc { /* private fields */ }
Implementations§
Source§impl SmartCalc
impl SmartCalc
pub fn add_dynamic_type<T: Borrow<str>>(&mut self, name: T) -> bool
pub fn add_dynamic_type_item<T: Borrow<str>>( &mut self, name: T, index: usize, format: T, parse: Vec<T>, upgrade_code: T, downgrade_code: T, names: Vec<String>, decimal_digits: Option<u8>, use_fract_rounding: Option<bool>, remove_fract_if_zero: Option<bool>, ) -> bool
pub fn set_money_configuration( &mut self, remove_fract_if_zero: bool, use_fract_rounding: bool, )
pub fn set_number_configuration( &mut self, decimal_digits: u8, remove_fract_if_zero: bool, use_fract_rounding: bool, )
pub fn set_percentage_configuration( &mut self, decimal_digits: u8, remove_fract_if_zero: bool, use_fract_rounding: bool, )
pub fn set_decimal_seperator(&mut self, decimal_seperator: String)
pub fn set_thousand_separator(&mut self, thousand_separator: String)
pub fn set_date_rule(&mut self, language: &str, rules: Vec<String>)
pub fn set_timezone(&mut self, timezone: String) -> Result<(), String>
pub fn get_time_offset(&self) -> TimeOffset
pub fn load_from_json(json_data: &str) -> Self
pub fn update_currency(&mut self, currency: &str, rate: f64) -> bool
pub fn delete_rule(&mut self, language: String, rule_name: String) -> bool
pub fn add_rule( &mut self, language: String, rules: Vec<String>, rule: Rc<dyn RuleTrait>, ) -> bool
pub fn format_result( &self, session: &Session, result: Rc<SmartCalcAstType>, ) -> String
pub fn initialize()
pub fn execute<Tlan: Borrow<str>, Tdata: Borrow<str>>( &self, language: Tlan, data: Tdata, ) -> ExecuteResult
pub fn basic_execute<T: Borrow<str>>( data: T, config: &SmartCalcConfig, ) -> Result<f64>
pub fn execute_session(&self, session: &Session) -> ExecuteResult
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SmartCalc
impl !RefUnwindSafe for SmartCalc
impl !Sync for SmartCalc
impl Unpin for SmartCalc
impl !UnwindSafe for SmartCalc
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