Skip to main content

Module username

Module username 

Source
Available on crate feature sys only.
Expand description

System username type for system information.

This module provides a type-safe abstraction for system usernames, ensuring valid username strings following POSIX rules.

§Username Format

System usernames follow POSIX rules:

  • Must be 1-32 characters
  • Must start with a letter or underscore
  • Can contain alphanumeric characters, underscores, and hyphens

§Examples

use bare_types::sys::Username;

// Parse from string
let username: Username = "root".parse()?;

// Access as string
assert_eq!(username.as_str(), "root");

Structs§

Username
System username.

Enums§

UsernameError
Error type for username parsing.