Skip to main content

FormState

Struct FormState 

Source
pub struct FormState { /* private fields */ }
Expand description

Host-form and bulk-tag editor state grouped off the App god-struct. Holds the add/edit host form, its dirty-check baseline, the bulk-tag editor, the last-apply snapshot used by u to revert bulk-tag changes and the pending-discard confirmation flag. Pure state container.

Implementations§

Source§

impl FormState

Source

pub fn request_discard_confirm(&mut self)

Arm the “Discard changes?” Esc dialog. Called when Esc fires on a form that has unsaved edits relative to its baseline.

Source

pub fn dismiss_discard_confirm(&mut self)

Clear the pending discard flag. Called on dialog dismiss, on successful save, and on form close.

Source

pub fn is_discard_pending(&self) -> bool

True when Esc should show the “Discard changes?” dialog instead of closing the form.

Source

pub fn host(&self) -> &HostForm

Source

pub fn host_mut(&mut self) -> &mut HostForm

Source

pub fn host_baseline(&self) -> Option<&FormBaseline>

Source

pub fn set_host_baseline(&mut self, baseline: Option<FormBaseline>)

Source

pub fn take_host_baseline(&mut self) -> Option<FormBaseline>

Source

pub fn bulk_tag_editor(&self) -> &BulkTagEditorState

Source

pub fn bulk_tag_editor_mut(&mut self) -> &mut BulkTagEditorState

Source

pub fn bulk_tag_undo(&self) -> Option<&Vec<(String, Vec<String>)>>

Source

pub fn set_bulk_tag_undo(&mut self, undo: Option<Vec<(String, Vec<String>)>>)

Source

pub fn take_bulk_tag_undo(&mut self) -> Option<Vec<(String, Vec<String>)>>

Trait Implementations§

Source§

impl Default for FormState

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V