pub struct MoveFundsState {
pub focused_field: MoveFundsField,
pub from_category: Option<CategoryId>,
pub to_category: Option<CategoryId>,
pub from_list_index: usize,
pub to_list_index: usize,
pub amount_input: String,
pub amount_cursor: usize,
pub error_message: Option<String>,
pub success_message: Option<String>,
}Expand description
State for the move funds dialog
Fields§
§focused_field: MoveFundsFieldCurrently focused field
from_category: Option<CategoryId>Selected source category
to_category: Option<CategoryId>Selected destination category
from_list_index: usizeIndex in the from category list
to_list_index: usizeIndex in the to category list
amount_input: StringAmount to move (as string for editing)
amount_cursor: usizeAmount cursor position
error_message: Option<String>Error message
success_message: Option<String>Success message
Implementations§
Source§impl MoveFundsState
impl MoveFundsState
pub fn new() -> Self
Sourcepub fn next_field(&mut self)
pub fn next_field(&mut self)
Move to next field
Sourcepub fn prev_field(&mut self)
pub fn prev_field(&mut self)
Move to previous field
Sourcepub fn clear_error(&mut self)
pub fn clear_error(&mut self)
Clear error message
Sourcepub fn set_success(&mut self, msg: impl Into<String>)
pub fn set_success(&mut self, msg: impl Into<String>)
Set success message
Sourcepub fn insert_char(&mut self, c: char)
pub fn insert_char(&mut self, c: char)
Insert character at cursor
Sourcepub fn move_right(&mut self)
pub fn move_right(&mut self)
Move cursor right
Sourcepub fn validate(&self) -> Result<(CategoryId, CategoryId, Money), String>
pub fn validate(&self) -> Result<(CategoryId, CategoryId, Money), String>
Validate the form
Trait Implementations§
Source§impl Clone for MoveFundsState
impl Clone for MoveFundsState
Source§fn clone(&self) -> MoveFundsState
fn clone(&self) -> MoveFundsState
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 MoveFundsState
impl Debug for MoveFundsState
Source§impl Default for MoveFundsState
impl Default for MoveFundsState
Source§fn default() -> MoveFundsState
fn default() -> MoveFundsState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MoveFundsState
impl RefUnwindSafe for MoveFundsState
impl Send for MoveFundsState
impl Sync for MoveFundsState
impl Unpin for MoveFundsState
impl UnwindSafe for MoveFundsState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more