pub struct Field {
pub id: &'static str,
pub label: &'static str,
pub kind: Kind,
pub value: String,
pub checked: bool,
pub locked: Option<&'static str>,
pub cursor: usize,
}Fields§
§id: &'static strWhat the code that reads the form calls it.
label: &'static strThe catalog key of its label.
kind: Kind§value: String§checked: bool§locked: Option<&'static str>The catalog key of the reason the field cannot be changed, when it cannot.
cursor: usizeWhere the cursor is, in characters from the start; only an area uses it.
Implementations§
Source§impl Field
impl Field
pub fn text(id: &'static str, label: &'static str, value: &str) -> Field
Sourcepub fn area(id: &'static str, label: &'static str, value: &str) -> Field
pub fn area(id: &'static str, label: &'static str, value: &str) -> Field
A text of several lines, with the cursor at its end.
Sourcepub fn line_col(&self) -> (usize, usize)
pub fn line_col(&self) -> (usize, usize)
The cursor as a line and a column (both from 0, in characters).
pub fn secret(id: &'static str, label: &'static str, value: &str) -> Field
pub fn check(id: &'static str, label: &'static str, checked: bool) -> Field
pub fn locked(self, reason: &'static str) -> Field
Trait Implementations§
impl Eq for Field
impl StructuralPartialEq for Field
Auto Trait Implementations§
impl Freeze for Field
impl RefUnwindSafe for Field
impl Send for Field
impl Sync for Field
impl Unpin for Field
impl UnsafeUnpin for Field
impl UnwindSafe for Field
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<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
Compare self to
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> ⓘ
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