Trait pwd_grp::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§
sourcefn getpwnam<S: PwdGrpString>(
&self,
name: impl AsRef<<S as Deref>::Target>
) -> Result<Option<Passwd<S>>>
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
sourcefn getpwuid<S: PwdGrpString>(&self, uid: uid_t) -> Result<Option<Passwd<S>>>
fn getpwuid<S: PwdGrpString>(&self, uid: uid_t) -> Result<Option<Passwd<S>>>
Look up a
passwd
entry by
uid,
returning strings as S
sourcefn getgrnam<S: PwdGrpString>(
&self,
name: impl AsRef<<S as Deref>::Target>
) -> Result<Option<Group<S>>>
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
sourcefn getgrgid<S: PwdGrpString>(&self, gid: uid_t) -> Result<Option<Group<S>>>
fn getgrgid<S: PwdGrpString>(&self, gid: uid_t) -> Result<Option<Group<S>>>
Look up a
group
entry by
gid,
returning strings as S
sourcefn getuid(&self) -> uid_t
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.
sourcefn geteuid(&self) -> uid_t
fn geteuid(&self) -> uid_t
Get the current process’s effective uid
This may be mocked,
via mock::MockPwdGrpProvider
.
effective uid
sourcefn getresuid(&self) -> (uid_t, uid_t, uid_t)
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.
sourcefn getgid(&self) -> uid_t
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.
sourcefn getegid(&self) -> uid_t
fn getegid(&self) -> uid_t
Get the current process’s effective gid
This may be mocked,
via mock::MockPwdGrpProvider
.
effective gid