pub struct UserRegistry {
pub users: Vec<UserRegistryEntry>,
}Expand description
The shared user registry (committed to git, append-only).
Fields§
§users: Vec<UserRegistryEntry>Implementations§
Source§impl UserRegistry
impl UserRegistry
Sourcepub fn next_user_id(&self) -> u32
pub fn next_user_id(&self) -> u32
Get the next available user ID.
Sourcepub fn register(&mut self, name: String, email: Option<String>) -> u32
pub fn register(&mut self, name: String, email: Option<String>) -> u32
Register a new user. Returns the assigned user ID.
Sourcepub fn find_by_name(&self, name: &str) -> Option<&UserRegistryEntry>
pub fn find_by_name(&self, name: &str) -> Option<&UserRegistryEntry>
Find a user by name.
Trait Implementations§
Source§impl Clone for UserRegistry
impl Clone for UserRegistry
Source§fn clone(&self) -> UserRegistry
fn clone(&self) -> UserRegistry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UserRegistry
impl Debug for UserRegistry
Source§impl Default for UserRegistry
impl Default for UserRegistry
Source§fn default() -> UserRegistry
fn default() -> UserRegistry
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for UserRegistry
impl<'de> Deserialize<'de> for UserRegistry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for UserRegistry
impl RefUnwindSafe for UserRegistry
impl Send for UserRegistry
impl Sync for UserRegistry
impl Unpin for UserRegistry
impl UnsafeUnpin for UserRegistry
impl UnwindSafe for UserRegistry
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