pub struct GroupFormState {
pub name_input: TextInput,
pub error_message: Option<String>,
pub editing_id: Option<CategoryGroupId>,
}Expand description
State for the group form dialog
Fields§
§name_input: TextInputName input
error_message: Option<String>Error message to display
editing_id: Option<CategoryGroupId>Group ID being edited (None for new group)
Implementations§
Source§impl GroupFormState
impl GroupFormState
Sourcepub fn init_for_edit(&mut self, group: &CategoryGroup)
pub fn init_for_edit(&mut self, group: &CategoryGroup)
Initialize the form for editing an existing group
Sourcepub fn build_group(&self) -> Result<CategoryGroup, String>
pub fn build_group(&self) -> Result<CategoryGroup, String>
Build a CategoryGroup from the form state
Sourcepub fn clear_error(&mut self)
pub fn clear_error(&mut self)
Clear any error message
Trait Implementations§
Source§impl Clone for GroupFormState
impl Clone for GroupFormState
Source§fn clone(&self) -> GroupFormState
fn clone(&self) -> GroupFormState
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 GroupFormState
impl Debug for GroupFormState
Auto Trait Implementations§
impl Freeze for GroupFormState
impl RefUnwindSafe for GroupFormState
impl Send for GroupFormState
impl Sync for GroupFormState
impl Unpin for GroupFormState
impl UnwindSafe for GroupFormState
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