pub struct PlanningForm {
pub kind: PlanningKind,
pub rows: Vec<(String, String)>,
pub cursor: usize,
pub editing: Option<String>,
}Expand description
The create/edit form for a cycle or milestone: a list of labelled field
rows with a focused cursor. editing is Some(old name) when the form
edits an existing item (a changed name triggers the rename cascade).
Fields§
§kind: PlanningKind§rows: Vec<(String, String)>§cursor: usize§editing: Option<String>Implementations§
Source§impl PlanningForm
impl PlanningForm
Sourcepub fn new(kind: PlanningKind) -> Self
pub fn new(kind: PlanningKind) -> Self
A blank create form for kind.
Sourcepub fn from_cycle(name: &str, cycle: &PlanningCycle) -> Self
pub fn from_cycle(name: &str, cycle: &PlanningCycle) -> Self
An edit form for a cycle, prefilled from name + cycle.
Sourcepub fn from_milestone(m: &Milestone) -> Self
pub fn from_milestone(m: &Milestone) -> Self
An edit form for a milestone, prefilled from m.
pub fn is_new(&self) -> bool
pub fn description(&self) -> &str
pub fn focused_label(&self) -> &str
Sourcepub fn focused_value(&self) -> &str
pub fn focused_value(&self) -> &str
The focused field’s typed value.
Sourcepub fn focused_is_date(&self) -> bool
pub fn focused_is_date(&self) -> bool
Whether the focused field is a picker-only date field. Date fields are
always the rows after Name and Description.
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 focus_next(&mut self)
pub fn focus_prev(&mut self)
pub fn insert_char(&mut self, c: char)
pub fn delete_char(&mut self)
pub fn render_with_bindings( &self, f: &mut Frame<'_>, area: Rect, bindings: &EffectiveBindings, context: InputContext, )
Trait Implementations§
Source§impl Clone for PlanningForm
impl Clone for PlanningForm
Auto Trait Implementations§
impl Freeze for PlanningForm
impl RefUnwindSafe for PlanningForm
impl Send for PlanningForm
impl Sync for PlanningForm
impl Unpin for PlanningForm
impl UnsafeUnpin for PlanningForm
impl UnwindSafe for PlanningForm
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