pub struct User {
pub id: Uuid,
pub spec_id: Option<String>,
pub name: String,
pub email: String,
pub handle: String,
pub pin_hash: Option<String>,
pub created_at: DateTime<Utc>,
pub archived: bool,
pub version: i64,
}Expand description
Represents a user in the system
Fields§
§id: UuidUnique identifier for the user
spec_id: Option<String>Human-friendly spec ID (e.g., “$USER-001”)
name: StringUser’s full name
email: StringUser’s email address
handle: StringUser’s handle for @mentions (without the @)
pin_hash: Option<String>Hashed PIN for simple authentication (SHA-256 hash stored as hex string) This is a basic authentication mechanism for web clients. For production use, consider a proper auth system (OAuth, JWT, etc.)
created_at: DateTime<Utc>When the user was created
archived: boolWhether the user is archived
version: i64Version number for optimistic locking (SQLite only)
Implementations§
Source§impl User
impl User
Sourcepub fn new(name: String, email: String, handle: String) -> Self
pub fn new(name: String, email: String, handle: String) -> Self
Creates a new user (without spec_id - use RequirementsStore::add_user for auto-generated ID)
Sourcepub fn new_with_spec_id(
name: String,
email: String,
handle: String,
spec_id: String,
) -> Self
pub fn new_with_spec_id( name: String, email: String, handle: String, spec_id: String, ) -> Self
Creates a new user with a spec_id
Sourcepub fn display_id(&self) -> &str
pub fn display_id(&self) -> &str
Returns display name: spec_id if available, otherwise name
Sourcepub fn verify_pin(&self, pin: &str) -> bool
pub fn verify_pin(&self, pin: &str) -> bool
Verify a PIN against the stored hash Returns true if the PIN matches, false otherwise Returns false if no PIN is set
Trait Implementations§
Source§impl<'de> Deserialize<'de> for User
impl<'de> Deserialize<'de> for User
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>,
Source§impl TS for User
impl TS for User
Source§type WithoutGenerics = User
type WithoutGenerics = User
WithoutGenerics should just be Self.
If the type does have generic parameters, then all generic parameters must be replaced with
a dummy type, e.g ts_rs::Dummy or ().
The only requirement for these dummy types is that EXPORT_TO must be None. Read moreSource§type OptionInnerType = User
type OptionInnerType = User
std::option::Option<T>, then this associated type is set to T.
All other implementations of TS should set this type to Self instead.Source§fn docs() -> Option<String>
fn docs() -> Option<String>
TS is derived, docs are
automatically read from your doc comments or #[doc = ".."] attributesSource§fn decl_concrete() -> String
fn decl_concrete() -> String
TS::decl().
If this type is not generic, then this function is equivalent to TS::decl().Source§fn decl() -> String
fn decl() -> String
type User = { user_id: number, ... }.
This function will panic if the type has no declaration. Read moreSource§fn inline() -> String
fn inline() -> String
{ user_id: number }.
This function will panic if the type cannot be inlined.Source§fn inline_flattened() -> String
fn inline_flattened() -> String
This function will panic if the type cannot be flattened.
Source§fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn output_path() -> Option<PathBuf>
fn output_path() -> Option<PathBuf>
T should be exported.The returned path does not include the base directory from
TS_RS_EXPORT_DIR. Read moreSource§fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn dependencies() -> Vec<Dependency>where
Self: 'static,
fn dependencies() -> Vec<Dependency>where
Self: 'static,
Source§fn export() -> Result<(), ExportError>where
Self: 'static,
fn export() -> Result<(), ExportError>where
Self: 'static,
TS::export_all. Read moreSource§fn export_all() -> Result<(), ExportError>where
Self: 'static,
fn export_all() -> Result<(), ExportError>where
Self: 'static,
To export only this type, without its dependencies, use
TS::export. Read moreSource§fn export_all_to(out_dir: impl AsRef<Path>) -> Result<(), ExportError>where
Self: 'static,
fn export_all_to(out_dir: impl AsRef<Path>) -> Result<(), ExportError>where
Self: 'static,
To export only this type, without its dependencies, use
TS::export. Read more