pub struct UserDirectory { /* private fields */ }Expand description
The people who can sign in, kept as records.
Implementations§
Source§impl UserDirectory
impl UserDirectory
Sourcepub fn new(space: SpaceMaker, roles: Vec<Role>) -> Result<Self, SpaceError>
pub fn new(space: SpaceMaker, roles: Vec<Role>) -> Result<Self, SpaceError>
Over what this makes. roles are what the application declares in code: a role record of
the same name gets what they say, and one is created if missing.
Sourcepub fn is_empty(&self) -> Result<bool, SpaceError>
pub fn is_empty(&self) -> Result<bool, SpaceError>
Whether nobody can sign in yet, so the first person has to be created.
Sourcepub fn create_first_administrator(
&self,
name: &str,
password: &str,
) -> Result<Identity, PasswordError>
pub fn create_first_administrator( &self, name: &str, password: &str, ) -> Result<Identity, PasswordError>
Creates the first person, as an administrator. It only works while there is nobody, so it cannot be used to get in later. Whoever opens a new installation first gets this, so it is for a program on someone’s machine: a server creates its first user in its setup.
Sourcepub fn identity_of(&self, name: &str) -> Result<Option<Identity>, SpaceError>
pub fn identity_of(&self, name: &str) -> Result<Option<Identity>, SpaceError>
Who this name is, if they can sign in, for a way of signing in that checked them itself.
Sourcepub fn identity_by_key(
&self,
key: &Value,
) -> Result<Option<Identity>, SpaceError>
pub fn identity_by_key( &self, key: &Value, ) -> Result<Option<Identity>, SpaceError>
Who this key is, as they stand now; nobody once they cannot sign in.
Trait Implementations§
Source§impl Authenticator for UserDirectory
impl Authenticator for UserDirectory
Source§fn authenticate(&self, credentials: &Credentials) -> Result<Identity, AuthError>
fn authenticate(&self, credentials: &Credentials) -> Result<Identity, AuthError>
Who this is, or why not.
Source§impl Clone for UserDirectory
impl Clone for UserDirectory
Source§fn clone(&self) -> UserDirectory
fn clone(&self) -> UserDirectory
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for UserDirectory
impl !Send for UserDirectory
impl !Sync for UserDirectory
impl !UnwindSafe for UserDirectory
impl Freeze for UserDirectory
impl Unpin for UserDirectory
impl UnsafeUnpin for UserDirectory
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