API
#os/user
Xu 0.8.8 API
import: #os/user
counts: 3 fns, 0 methods, 1 types, 0 consts, 0 ifaces
Current user from uid/gid + USER/HOME. Lookup only succeeds for the current user.
struct User
pub struct User {
pub uid string
pub gid string
pub username string
pub name string
pub home_dir string
}
Purpose
`os/user` subset. Current is filled from uid/gid + USER/HOME (no getpwuid). Lookup/LookupId succeed only for the current user.
Parameters
uid string- field (string)
gid string- field (string)
username string- field (string)
name string- name
home_dir string- field (string)
current
Purpose
current; returns User.
Parameters
none
Returns
User — a value of this type
lookup
pub fn lookup(username string) User
Purpose
Lookup. Throws on failure.
Parameters
username string- username (string)
Returns
User — a value of this type
lookup_id
pub fn lookup_id(uid string) User
Purpose
Lookup id. Throws on failure.
Parameters
uid string- uid (string)
Returns
User — a value of this type