pub struct FormState {}Fields§
§title: String§status: String§priority: String§labels: String§assignee: String§estimate: String§cycles: String§milestones: String§reviewer: String§start_date: String§due_date: String§parent: StringThe chosen parent’s number, as a string (WP06 / T026).
A String for the same reason assignee is one: the form’s fields are
uniformly text, and each is parsed and validated at submit rather than at
the keystroke. Empty means no parent, which carries the same meaning as an
empty --parent "" on the CLI.
focus: FormFocusImplementations§
Source§impl FormState
impl FormState
pub fn new(default_status: &str) -> Self
pub fn with_default_assignee( default_status: &str, default_assignee: &str, ) -> Self
Sourcepub fn from_issue(issue: &Issue) -> Self
pub fn from_issue(issue: &Issue) -> Self
This form with every field prefilled from an existing issue — the TUI’s “clone issue” action (tix #1484).
Exactly the fields the form has are carried over, which is exactly the
fields creation takes: number, created, commit and History are not
creation inputs, so they are not carried. The title is copied verbatim
rather than suffixed with “copy”: the user asked for the source’s data, a
title is not an identity (numbers are), and inventing a naming convention
here would put a string in the user’s issue that no command in this tool
produces.
Multivalued fields are filled in the same comma-separated form the submit
path parses (labels, cycles, milestones), so a clone submitted
unchanged round-trips the source’s values exactly.
Sourcepub fn value_of(&self, focus: FormFocus) -> &str
pub fn value_of(&self, focus: FormFocus) -> &str
This form’s value for focus, regardless of which field is focused.
focused_value is value_of(self.focus). The indirection exists so the
renderer can walk FormFocus::RING and read each field in turn, which is
what lets one list drive both the labels and the focus index.
pub fn focused_value(&self) -> &str
pub fn focused_value_mut(&mut self) -> &mut String
pub fn insert_char(&mut self, c: char)
pub fn delete_char(&mut self)
Sourcepub fn is_date_focus(&self) -> bool
pub fn is_date_focus(&self) -> bool
Whether the focused field is a picker-only date field.
Sourcepub fn focused_date_is_complete(&self) -> bool
pub fn focused_date_is_complete(&self) -> bool
Whether the focused date field already holds a complete, valid date.
Sourcepub fn set_focused_date(&mut self, value: &str)
pub fn set_focused_date(&mut self, value: &str)
Overwrite the focused date field (no-op when it isn’t a date field).
pub fn move_focus_next(&mut self)
pub fn move_focus_prev(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FormState
impl RefUnwindSafe for FormState
impl Send for FormState
impl Sync for FormState
impl Unpin for FormState
impl UnsafeUnpin for FormState
impl UnwindSafe for FormState
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
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> ⓘ
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> ⓘ
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