pub struct CalculatorApp { /* private fields */ }Expand description
Calculator application state
Implementations§
Source§impl CalculatorApp
impl CalculatorApp
Sourcepub fn with_validator(validator: AnomalyValidator) -> Self
pub fn with_validator(validator: AnomalyValidator) -> Self
Creates a calculator app with custom Anomaly validator
Sourcepub fn should_quit(&self) -> bool
pub fn should_quit(&self) -> bool
Returns whether the app should quit
Sourcepub fn set_cursor(&mut self, pos: usize)
pub fn set_cursor(&mut self, pos: usize)
Sets the cursor position directly (for testing)
Sourcepub fn insert_char(&mut self, c: char)
pub fn insert_char(&mut self, c: char)
Inserts a character at the cursor position
Sourcepub fn delete_char(&mut self)
pub fn delete_char(&mut self)
Deletes the character before the cursor (backspace)
Sourcepub fn delete_char_forward(&mut self)
pub fn delete_char_forward(&mut self)
Deletes the character at the cursor (delete key)
Sourcepub fn move_cursor_left(&mut self)
pub fn move_cursor_left(&mut self)
Moves the cursor left
Sourcepub fn move_cursor_right(&mut self)
pub fn move_cursor_right(&mut self)
Moves the cursor right
Sourcepub fn move_cursor_start(&mut self)
pub fn move_cursor_start(&mut self)
Moves cursor to the beginning of input
Sourcepub fn move_cursor_end(&mut self)
pub fn move_cursor_end(&mut self)
Moves cursor to the end of input
Sourcepub fn result_display(&self) -> String
pub fn result_display(&self) -> String
Returns the result as a display string
Sourcepub fn recall_last(&mut self)
pub fn recall_last(&mut self)
Loads the last history entry into input
Sourcepub fn jidoka_status(&self) -> Vec<String>
pub fn jidoka_status(&self) -> Vec<String>
Gets the Anomaly status as a display string
Trait Implementations§
Source§impl Debug for CalculatorApp
impl Debug for CalculatorApp
Auto Trait Implementations§
impl Freeze for CalculatorApp
impl RefUnwindSafe for CalculatorApp
impl Send for CalculatorApp
impl Sync for CalculatorApp
impl Unpin for CalculatorApp
impl UnsafeUnpin for CalculatorApp
impl UnwindSafe for CalculatorApp
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