Trait DataItem

Source
pub trait DataItem: Debug {
    // Required methods
    fn unary(&self, unary: UnaryType) -> Rc<dyn DataItem>;
    fn is_same(&self, other: &dyn Any) -> bool;
    fn as_token_type(&self) -> TokenType;
    fn as_any(&self) -> &dyn Any;
    fn get_number(&self, other: &dyn DataItem) -> f64;
    fn get_underlying_number(&self) -> f64;
    fn type_name(&self) -> &'static str;
    fn type_id(&self) -> TypeId;
    fn calculate(
        &self,
        config: &SmartCalcConfig,
        on_left: bool,
        other: &dyn DataItem,
        operation_type: OperationType,
    ) -> Option<Rc<dyn DataItem>>;
    fn print(&self, config: &SmartCalcConfig, session: &Session) -> String;
}

Required Methods§

Source

fn unary(&self, unary: UnaryType) -> Rc<dyn DataItem>

Source

fn is_same(&self, other: &dyn Any) -> bool

Source

fn as_token_type(&self) -> TokenType

Source

fn as_any(&self) -> &dyn Any

Source

fn get_number(&self, other: &dyn DataItem) -> f64

Source

fn get_underlying_number(&self) -> f64

Source

fn type_name(&self) -> &'static str

Source

fn type_id(&self) -> TypeId

Source

fn calculate( &self, config: &SmartCalcConfig, on_left: bool, other: &dyn DataItem, operation_type: OperationType, ) -> Option<Rc<dyn DataItem>>

Source

fn print(&self, config: &SmartCalcConfig, session: &Session) -> String

Implementors§