#[non_exhaustive]pub struct NewUser {
pub username: String,
pub password: Option<String>,
}Expand description
Inputs needed to create a user account.
Use the passwordless constructor for embedded or
single-user applications where login latency matters and the surrounding
process is already trusted; use with_password for
multi-user deployments where the root key must be encrypted at rest.
The struct is marked #[non_exhaustive] so we can add fields
(key algorithm, locale, initial roles, etc.) without a breaking API
change. Construct it through the provided helpers rather than struct
literal syntax.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.username: StringLogin identifier for the user. Must be unique within the instance.
password: Option<String>Optional password. None produces a passwordless user whose root key
is stored unencrypted (fine for embedded apps where the host process
is the trust boundary); Some(_) produces an Argon2id-derived
encryption key under which the root signing key is AES-256-GCM
encrypted at rest.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NewUser
impl RefUnwindSafe for NewUser
impl Send for NewUser
impl Sync for NewUser
impl Unpin for NewUser
impl UnsafeUnpin for NewUser
impl UnwindSafe for NewUser
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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