pub struct Profile {
pub name: String,
pub email: String,
pub password: Option<String>,
pub password_confirmation: String,
pub current_password: Option<String>,
}Expand description
The profile form PasswordAuth edits a
PasswordAccount through, and a custom ProfileEditor can take as
its input: a name, an email address, an optional new password typed twice, and the current
password.
Fields§
§name: StringThe display name, posted as name.
email: StringThe email address the account signs in with, posted as email.
password: Option<String>The new password, posted as password; None when left blank, which keeps the current
one.
password_confirmation: StringThe new password typed again, posted as password_confirmation.
current_password: Option<String>The password the account signs in with today, posted as current_password; None when
left blank.
Implementations§
Source§impl Profile
impl Profile
Sourcepub fn password_errors(&self) -> FieldErrors
pub fn password_errors(&self) -> FieldErrors
The refusals new_password_errors makes of a new password; none when the profile keeps
the current one.
Trait Implementations§
Source§impl Debug for Profile
Redacts the passwords, so a profile logged with ? writes none to the log.
impl Debug for Profile
Redacts the passwords, so a profile logged with ? writes none to the log.
impl Eq for Profile
Source§impl FormFields for Profile
impl FormFields for Profile
Source§type Field = ProfileField
type Field = ProfileField
What an error names: one variant per field, or a form key.
Source§type Keys = ProfileKeys
type Keys = ProfileKeys
One key per field, named like the field, which an error picks a field from: the derive
writes
UserFormKeys, holding age: UserFormField::Age; a form with no field has ().Source§fn keys() -> ProfileKeys
fn keys() -> ProfileKeys
The keys.
Source§impl FormInput for Profile
impl FormInput for Profile
Source§fn key(field: ProfileField) -> &'static str
fn key(field: ProfileField) -> &'static str
The form key
field posts under.Source§fn schema() -> Schema
fn schema() -> Schema
The value’s controls, each posting its own key. An empty schema asks for nothing: an
action runs on its button.
Source§fn parse(_cx: &Cx, values: &FormValues) -> Result<Profile, Vec<FieldError>>
fn parse(_cx: &Cx, values: &FormValues) -> Result<Profile, Vec<FieldError>>
Source§fn write(&self, out: &mut FormValues)
fn write(&self, out: &mut FormValues)
Write the value’s keys as its form posts them: a repeater fills a stored item’s row from
them, and its detail-page column reads them. A password writes nothing, as it never renders
back into a form. Nothing writes an action’s input or a sign-up, so a type used only there
writes nothing too.
impl StructuralPartialEq for Profile
Auto Trait Implementations§
impl Freeze for Profile
impl RefUnwindSafe for Profile
impl Send for Profile
impl Sync for Profile
impl Unpin for Profile
impl UnsafeUnpin for Profile
impl UnwindSafe for Profile
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.