use crate::login; // Stable identifier for a User. Prefixed with `U`. Users created before March, 2025 may have an `L` // prefix, instead. 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(login: login::Id) -> Self { Self::from(String::from(login)) } } impl PartialEq for Id { fn eq(&self, other: &login::Id) -> bool { self.as_str().eq(other.as_str()) } } #[derive(Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] pub struct User; impl crate::id::Prefix for User { fn prefix(&self) -> &'static str { "U" } }