#[non_exhaustive]pub struct AccountRecord {
pub id: String,
pub name: String,
pub password_hash: String,
pub display_name: Option<String>,
pub email: Option<String>,
pub groups: Vec<String>,
pub disabled: bool,
pub made_unix: Option<i64>,
}Expand description
One password account as a [Table] keeps it, keyed by name.
It derives guatiao’s ToValue, FromValue and Schema, so a [Table] may keep it in
any format.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: StringStable identity; what a [Verdict::Valid] lookup names.
name: StringThe name the person signs in with; unique in the table.
password_hash: StringThe Argon2id hash of the password, as [PasswordHasher::hash] makes it.
display_name: Option<String>Human-readable name.
email: Option<String>Email address.
groups: Vec<String>Directory groups.
disabled: boolA disabled account neither authenticates nor resolves.
made_unix: Option<i64>When it was made, in seconds since the Unix epoch.
Implementations§
Source§impl AccountRecord
impl AccountRecord
Sourcepub fn new(
id: impl Into<String>,
name: impl Into<String>,
password_hash: impl Into<String>,
) -> Self
pub fn new( id: impl Into<String>, name: impl Into<String>, password_hash: impl Into<String>, ) -> Self
An enabled account with no groups. password_hash comes from [PasswordHasher::hash].
Sourcepub fn groups(self, groups: impl IntoIterator<Item = impl Into<String>>) -> Self
pub fn groups(self, groups: impl IntoIterator<Item = impl Into<String>>) -> Self
Sets the directory groups.
Sourcepub fn display_name(self, display_name: impl Into<String>) -> Self
pub fn display_name(self, display_name: impl Into<String>) -> Self
Sets the human-readable name.
Trait Implementations§
Source§impl Clone for AccountRecord
impl Clone for AccountRecord
Source§impl Debug for AccountRecord
impl Debug for AccountRecord
impl Eq for AccountRecord
Source§impl FromValue for AccountRecord
impl FromValue for AccountRecord
Source§const KINDS: Kinds = ::coqui_access::guatiao::Kinds::MAP
const KINDS: Kinds = ::coqui_access::guatiao::Kinds::MAP
The kinds
from_value may accept; any
other is refused. Every impl in this crate and every derived one
says; the default, [Kinds::ANY], claims every kind, which keeps
a type that does not say out of an enum told apart by kind.Source§fn from_value(__value: &Value) -> Result<Self, MapError>
fn from_value(__value: &Value) -> Result<Self, MapError>
Performs the conversion. Read more
Source§impl FromWalk for AccountRecord
impl FromWalk for AccountRecord
Source§impl Keyed for AccountRecord
impl Keyed for AccountRecord
Source§impl MapRead for AccountRecord
impl MapRead for AccountRecord
Source§impl PartialEq for AccountRecord
impl PartialEq for AccountRecord
Source§impl Schema for AccountRecord
impl Schema for AccountRecord
impl StructuralPartialEq for AccountRecord
Source§impl ToValue for AccountRecord
impl ToValue for AccountRecord
Auto Trait Implementations§
impl Freeze for AccountRecord
impl RefUnwindSafe for AccountRecord
impl Send for AccountRecord
impl Sync for AccountRecord
impl Unpin for AccountRecord
impl UnsafeUnpin for AccountRecord
impl UnwindSafe for AccountRecord
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,
§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.