pub struct UserID { /* private fields */ }Expand description
Identity of a user (author or committer).
Contains a name and an email. Both are required to be non‑empty.
The name is also validated against MAX_NAME_LENGTH.
§Example
use libvctrl_handler::UserID;
let user = UserID::new("Alice".into(), "alice@example.com".into())
.expect("valid user");
assert_eq!(user.name(), "Alice");
assert_eq!(user.email(), "alice@example.com");
// Empty fields are rejected.
assert!(UserID::new("".into(), "x@y".into()).is_err());
assert!(UserID::new("Alice".into(), "".into()).is_err());Implementations§
Trait Implementations§
impl Eq for UserID
impl StructuralPartialEq for UserID
Auto Trait Implementations§
impl Freeze for UserID
impl RefUnwindSafe for UserID
impl Send for UserID
impl Sync for UserID
impl Unpin for UserID
impl UnsafeUnpin for UserID
impl UnwindSafe for UserID
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