pub trait PwdGrpProvider: SealedProvider {
    // Provided methods
    fn getpwnam<S: PwdGrpString>(
        &self,
        name: impl AsRef<<S as Deref>::Target>
    ) -> Result<Option<Passwd<S>>> { ... }
    fn getpwuid<S: PwdGrpString>(&self, uid: uid_t) -> Result<Option<Passwd<S>>> { ... }
    fn getgrnam<S: PwdGrpString>(
        &self,
        name: impl AsRef<<S as Deref>::Target>
    ) -> Result<Option<Group<S>>> { ... }
    fn getgrgid<S: PwdGrpString>(&self, gid: uid_t) -> Result<Option<Group<S>>> { ... }
    fn getuid(&self) -> uid_t { ... }
    fn geteuid(&self) -> uid_t { ... }
    fn getresuid(&self) -> (uid_t, uid_t, uid_t) { ... }
    fn getgid(&self) -> uid_t { ... }
    fn getegid(&self) -> uid_t { ... }
    fn getresgid(&self) -> (uid_t, uid_t, uid_t) { ... }
    fn getgroups(&self) -> Result<Vec<uid_t>> { ... }
}
Expand description

Provider of passwd and group information.

Normally, use PwdGrp.

This may be mocked, via mock::MockPwdGrpProvider.

Provided Methods§

source

fn getpwnam<S: PwdGrpString>( &self, name: impl AsRef<<S as Deref>::Target> ) -> Result<Option<Passwd<S>>>

Look up a passwd entry by name, returning strings as S

source

fn getpwuid<S: PwdGrpString>(&self, uid: uid_t) -> Result<Option<Passwd<S>>>

Look up a passwd entry by uid, returning strings as S

source

fn getgrnam<S: PwdGrpString>( &self, name: impl AsRef<<S as Deref>::Target> ) -> Result<Option<Group<S>>>

Look up a group entry by name, returning strings as S

source

fn getgrgid<S: PwdGrpString>(&self, gid: uid_t) -> Result<Option<Group<S>>>

Look up a group entry by gid, returning strings as S

source

fn getuid(&self) -> uid_t

Get the current process’s (real) uid

This may be mocked, via mock::MockPwdGrpProvider. (real) uid “Real” is the Unix technical term: ruid vs euid/suid/fsuid.

source

fn geteuid(&self) -> uid_t

Get the current process’s effective uid

This may be mocked, via mock::MockPwdGrpProvider. effective uid

source

fn getresuid(&self) -> (uid_t, uid_t, uid_t)

Get the current process’s real, effective and saved set-uid

This may be mocked, via mock::MockPwdGrpProvider. real, effective and saved set-uid “Real” is the Unix technical term: ruid vs euid/suid/fsuid.

source

fn getgid(&self) -> uid_t

Get the current process’s (real) gid

This may be mocked, via mock::MockPwdGrpProvider. (real) gid “Real” is the Unix technical term: ruid vs euid/suid/fsuid.

source

fn getegid(&self) -> uid_t

Get the current process’s effective gid

This may be mocked, via mock::MockPwdGrpProvider. effective gid

source

fn getresgid(&self) -> (uid_t, uid_t, uid_t)

Get the current process’s real, effective and saved set-gid

This may be mocked, via mock::MockPwdGrpProvider. real, effective and saved set-gid “Real” is the Unix technical term: ruid vs euid/suid/fsuid.

source

fn getgroups(&self) -> Result<Vec<uid_t>>

Get the current process’s supplementary group list

Implementors§