XU XUv0.16.0

#os/user

import: #os/user

counts: 3 functions, 0 methods, 1 types, 0 constants, 0 method sets

Current user from uid/gid + USER/HOME. Lookup only succeeds for the current user.

struct User

XuAPI
pub struct User {
    pub uid string
    pub gid string
    pub username string
    pub name string
    pub home_dir string
}

Purpose

Structure encapsulating uid, gid, username, name, home_dir.

Public fields

uid string
field (string)
gid string
field (string)
username string
field (string)
name string
name
home_dir string
field (string)

current

XuAPI
pub fn current() User

Purpose

Execute current.

Parameters

No arguments are required.

Returns

User — a value of this type

lookup

XuAPI
pub fn lookup(username string) User

Purpose

Look up matching key or item in index or collection. Throws on failure; handle the error or propagate it to the caller.

Parameters

username string
username (string)

Returns

User — a value of this type

lookup_id

XuAPI
pub fn lookup_id(uid string) User

Purpose

Lookup id. Throws on failure; handle the error or propagate it to the caller.

Parameters

uid string
uid (string)

Returns

User — a value of this type