Skip to main content

PwdGrpProvider

Trait PwdGrpProvider 

Source
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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§