pub struct SnippetState {
pub store: SnippetStore,
pub form: SnippetForm,
pub pending: Option<(Snippet, Vec<String>)>,
pub output: Option<SnippetOutputState>,
pub param_form: Option<SnippetParamFormState>,
pub pending_terminal: bool,
pub form_baseline: Option<SnippetFormBaseline>,
pub pending_delete: Option<usize>,
}Expand description
Snippet-owned state grouped off the App god-struct. Holds the on-disk
snippet store, the edit form, the pending execution payload, the output
screen state, the param form, the terminal-submit flag, the dirty-check
baseline and the pending-delete index. Pure state container.
Fields§
§store: SnippetStore§form: SnippetForm§pending: Option<(Snippet, Vec<String>)>§output: Option<SnippetOutputState>§param_form: Option<SnippetParamFormState>§pending_terminal: bool§form_baseline: Option<SnippetFormBaseline>§pending_delete: Option<usize>Implementations§
Source§impl SnippetState
impl SnippetState
Sourcepub fn with_store_loaded() -> Self
pub fn with_store_loaded() -> Self
Construct with snippet store loaded from disk.
Sourcepub fn request_delete(&mut self, idx: usize)
pub fn request_delete(&mut self, idx: usize)
Open a delete confirmation for the snippet at idx. The renderer
reads pending_delete to draw the confirm overlay.
Sourcepub fn cancel_delete(&mut self)
pub fn cancel_delete(&mut self)
Dismiss a pending delete confirmation. Idempotent.
Sourcepub fn close_param_form(&mut self)
pub fn close_param_form(&mut self)
Close the parameter substitution form. Clears the form state and the terminal-submit flag that decide whether the next Enter sends the resolved command to the foreground terminal or to background output capture. Idempotent.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SnippetState
impl RefUnwindSafe for SnippetState
impl Send for SnippetState
impl Sync for SnippetState
impl Unpin for SnippetState
impl UnsafeUnpin for SnippetState
impl UnwindSafe for SnippetState
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> 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