pub async fn load_all_users_and_groups() -> Result<()>
Expand description
Loads all users and groups from the filesystem into memory.
This function scans the /System/Users
and /System/Groups
directories,
reads all user and group files, and adds them to the Users manager.
It should be called during system initialization.
§Returns
Returns Ok(())
if all users and groups were loaded successfully,
or an Error
if any operation failed.
§Errors
This function can return errors in the following cases:
- Failed to read users or groups directory
- Failed to parse user or group files
- Failed to add users or groups to the Users manager
§Examples
use authentication::load_all_users_and_groups;
async fn example() -> Result<(), authentication::Error> {
load_all_users_and_groups().await?;
Ok(())
}