pub struct ScheduleState {
pub tab: ScheduleTab,
pub selected: usize,
pub prompt: Option<CycleReasonPrompt>,
pub form: Option<ScheduleForm>,
pub series_form: Option<SeriesForm>,
}Expand description
The page’s own state: which tab is showing, which row the cursor is on, the reason prompt when one is open, and the create/edit form when one is.
Session-only: nothing here is persisted, and the page owns no value the services do not already own.
Fields§
§tab: ScheduleTabThe tab in view.
selected: usizeThe selected row within the active tab.
prompt: Option<CycleReasonPrompt>The reason prompt, Some exactly while the page is collecting the reason a
lifecycle action records (T037).
form: Option<ScheduleForm>The create/edit form, Some exactly while the page is defining a schedule
(T036).
series_form: Option<SeriesForm>The Series tab’s create form, Some exactly while the page is defining a
recurring series.
A separate field from Self::form rather than a variant of it: the two
forms collect different fields (title/rule/anchor against the ten cycle
schedule fields) and submit to different services, and one Option per form
is what makes “which tab defined what” a property of the state rather than
something a render has to infer.
Implementations§
Source§impl ScheduleState
impl ScheduleState
Sourcepub fn move_selected(&mut self, delta: isize, rows: usize) -> bool
pub fn move_selected(&mut self, delta: isize, rows: usize) -> bool
Move the cursor by delta, clamped to rows entries.
Sourcepub fn clamp_selected(&mut self, rows: usize)
pub fn clamp_selected(&mut self, rows: usize)
Clamp the cursor into rows entries, for a registry that changed under the
page.
Sourcepub fn switch_tab(&mut self, delta: isize)
pub fn switch_tab(&mut self, delta: isize)
Step to the next (delta ≥ 0) or previous tab, wrapping, and reset the row
cursor: it indexes the active tab’s rows, so it must not carry over.
Trait Implementations§
Source§impl Clone for ScheduleState
impl Clone for ScheduleState
Source§impl Debug for ScheduleState
impl Debug for ScheduleState
Source§impl Default for ScheduleState
impl Default for ScheduleState
impl Eq for ScheduleState
Source§impl PartialEq for ScheduleState
impl PartialEq for ScheduleState
impl StructuralPartialEq for ScheduleState
Auto Trait Implementations§
impl Freeze for ScheduleState
impl RefUnwindSafe for ScheduleState
impl Send for ScheduleState
impl Sync for ScheduleState
impl Unpin for ScheduleState
impl UnsafeUnpin for ScheduleState
impl UnwindSafe for ScheduleState
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