pub struct Form {
pub original: Option<String>,
pub is_default: bool,
pub status: Option<(bool, String)>,
/* private fields */
}Fields§
§original: Option<String>The name of the profile being edited; None on a new profile.
is_default: bool§status: Option<(bool, String)>The result line (connection test, save error), with true if it is an error.
Implementations§
Source§impl Form
impl Form
Sourcepub fn new(
existing: Option<(&str, &Profile)>,
is_default: bool,
taken_names: Vec<String>,
) -> Form
pub fn new( existing: Option<(&str, &Profile)>, is_default: bool, taken_names: Vec<String>, ) -> Form
A new form (existing empty) or filled in with a profile. taken_names are the
names that already exist, to refuse a repeated one.
pub fn name(&self) -> &str
pub fn dirty(&self) -> bool
Sourcepub fn profile(&self) -> Profile
pub fn profile(&self) -> Profile
The profile with the fields filled in (empty ones are left out). Ignores invalid fields.
pub fn is_valid(&self) -> bool
pub fn handle(&mut self, key: Key) -> FormEvent
pub fn render(&self, style: Style, width: usize, height: usize) -> Frame
Trait Implementations§
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> 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<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