pub struct Editor {
pub purpose: Purpose,
pub fields: Vec<Field>,
pub focus: usize,
pub error: Option<String>,
pub note: Option<(bool, String)>,
pub busy: bool,
}Fields§
§purpose: Purpose§fields: Vec<Field>§focus: usize§error: Option<String>Why the last attempt to save did not work.
note: Option<(bool, String)>The result of a test of the connection: true for a failure.
busy: boolA call is running: the keys wait.
Implementations§
Source§impl Editor
impl Editor
pub fn new(purpose: Purpose, fields: Vec<Field>) -> Editor
pub fn field(&self, id: &str) -> Option<&Field>
pub fn text(&self, id: &str) -> &str
pub fn checked(&self, id: &str) -> bool
Sourcepub fn focus_on(&mut self, id: &str)
pub fn focus_on(&mut self, id: &str)
Puts the focus on a field by its id (to point at what is wrong).
Sourcepub fn insert(&mut self, text: &str)
pub fn insert(&mut self, text: &str)
Adds typed or pasted text to the focused field. A line field drops the line breaks; an area keeps them.
pub fn handle(&mut self, event: &KeyEvent) -> Outcome
Trait Implementations§
impl Eq for Editor
impl StructuralPartialEq for Editor
Auto Trait Implementations§
impl Freeze for Editor
impl RefUnwindSafe for Editor
impl Send for Editor
impl Sync for Editor
impl Unpin for Editor
impl UnsafeUnpin for Editor
impl UnwindSafe for Editor
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