use crate::user; pub type Id = crate::id::Id; // Login IDs and user IDs are typewise-distinct as they identify things in different namespaces, but // in practice a login and its associated user _must_ have IDs that encode to the same value. The // two ID types are made interconvertible (via `From`) for this purpose. impl From for Id { fn from(user: user::Id) -> Self { Self::from(String::from(user)) } } impl PartialEq for Id { fn eq(&self, other: &user::Id) -> bool { self.as_str().eq(other.as_str()) } } #[derive(Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] pub struct Login; impl crate::id::Prefix for Login { fn prefix(&self) -> &'static str { user::id::User.prefix() } }