pub struct SeriesForm {
pub fields: Vec<SeriesField>,
pub values: Vec<String>,
pub focus: usize,
pub error: Option<String>,
}Expand description
The Series tab’s create form.
A page-local form, the twin of ScheduleForm: the page owns it, so defining
a series needs no new mode, no new InputContext and no new binding. It collects
text and nothing else — every rule about what the text may be is the shared create
service’s, and a refusal keeps the form open with the message on it rather than
closing and losing what was typed.
Fields§
§fields: Vec<SeriesField>The fields shown, in row order.
values: Vec<String>The typed value per shown field, in the same order.
focus: usizeThe focused row.
error: Option<String>The refusal the last save produced, kept while the form stays open.
Implementations§
Source§impl SeriesForm
impl SeriesForm
Sourcepub const NOTE: &'static str = "`interval` and `cron-like` rules need the CLI: \
`tix recurring create --rule <FAMILY> --interval \
<N> --unit <UNIT>`."
pub const NOTE: &'static str = "`interval` and `cron-like` rules need the CLI: \ `tix recurring create --rule <FAMILY> --interval \ <N> --unit <UNIT>`."
Where the rule families the form cannot express are defined.
The three fields complete daily, weekly and monthly. The other two
families need arguments the form does not collect, so rather than offer them
(and refuse), the form says where they live — the same service, the CLI’s own
flags. Asserted against [SeriesField::Rule::hint] by a test, so the two can
not drift apart again.
Sourcepub fn create() -> Self
pub fn create() -> Self
A form that creates a series: every field empty, the title focused first.
Sourcepub fn title(&self) -> &'static str
pub fn title(&self) -> &'static str
The form’s block title: what it is about to do, and the keys it answers to.
Sourcepub fn focused(&self) -> SeriesField
pub fn focused(&self) -> SeriesField
The focused field.
Sourcepub fn value(&self, field: SeriesField) -> &str
pub fn value(&self, field: SeriesField) -> &str
The typed value of field ("" when the form does not show it).
Sourcepub fn focus_next(&mut self)
pub fn focus_next(&mut self)
Step the focus forward, wrapping.
Sourcepub fn focus_prev(&mut self)
pub fn focus_prev(&mut self)
Step the focus backward, wrapping.
Sourcepub fn insert_char(&mut self, c: char)
pub fn insert_char(&mut self, c: char)
Append a character to the focused field.
Sourcepub fn delete_char(&mut self)
pub fn delete_char(&mut self)
Remove the focused field’s last character.
Sourcepub fn clear_field(&mut self)
pub fn clear_field(&mut self)
Empty the focused field, for a value being replaced rather than extended.
Trait Implementations§
Source§impl Clone for SeriesForm
impl Clone for SeriesForm
Source§impl Debug for SeriesForm
impl Debug for SeriesForm
impl Eq for SeriesForm
Source§impl PartialEq for SeriesForm
impl PartialEq for SeriesForm
impl StructuralPartialEq for SeriesForm
Auto Trait Implementations§
impl Freeze for SeriesForm
impl RefUnwindSafe for SeriesForm
impl Send for SeriesForm
impl Sync for SeriesForm
impl Unpin for SeriesForm
impl UnsafeUnpin for SeriesForm
impl UnwindSafe for SeriesForm
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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