Skip to main content

Form

Struct Form 

Source
pub struct Form {
    pub title: &'static str,
    pub fields: Vec<Field>,
    pub cursor: usize,
}

Fields§

§title: &'static str§fields: Vec<Field>§cursor: usize

Which field the caret is on.

Implementations§

Source§

impl Form

Source

pub fn new_schedule() -> Self

The fields temporal schedule create needs.

workflow id is the id given to the workflows the schedule starts, not the schedule’s own id; the server appends the scheduled time to it, so the two are different things and naming both avoids the guess.

Source

pub fn next(&mut self)

Move down a field, wrapping. Tab in a form goes forward and stops nowhere.

Source

pub fn previous(&mut self)

Source

pub fn push(&mut self, c: char)

Source

pub fn backspace(&mut self) -> bool

Delete backwards. Reports whether anything was there, so the caller can decide what an empty backspace means.

Source

pub fn get(&self, label: &str) -> &str

The value of a field by label, trimmed. Empty when absent.

Source

pub fn missing(&self) -> Option<&'static str>

The first required field still empty, if any.

Checked before the confirmation rather than after, so the reader is sent back to the field that is missing instead of reading a command with a hole in it.

Source

pub fn focus(&mut self, label: &str)

Put the caret on a named field, for jumping to the one that failed validation.

Trait Implementations§

Source§

impl Clone for Form

Source§

fn clone(&self) -> Form

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Form

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Form

Source§

impl PartialEq for Form

Source§

fn eq(&self, other: &Form) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Form

Auto Trait Implementations§

§

impl Freeze for Form

§

impl RefUnwindSafe for Form

§

impl Send for Form

§

impl Sync for Form

§

impl Unpin for Form

§

impl UnsafeUnpin for Form

§

impl UnwindSafe for Form

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.