diff options
author | Taiki Endo <te316e89@gmail.com> | 2020-10-11 16:31:26 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-11 09:31:26 +0200 |
commit | b047f647b70acaedb282dabf5dd3a28ee90c2060 (patch) | |
tree | 110c8cb6de395a72adfbf3d6e3cd25aa2760774e /tokio/src/net/unix/ucred.rs | |
parent | 2e05399f4b6be41680036cc158348973689840ca (diff) |
net: make UCred fields private (#2936)
Diffstat (limited to 'tokio/src/net/unix/ucred.rs')
-rw-r--r-- | tokio/src/net/unix/ucred.rs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tokio/src/net/unix/ucred.rs b/tokio/src/net/unix/ucred.rs index 466aedc2..ef214a70 100644 --- a/tokio/src/net/unix/ucred.rs +++ b/tokio/src/net/unix/ucred.rs @@ -4,9 +4,21 @@ use libc::{gid_t, uid_t}; #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] pub struct UCred { /// UID (user ID) of the process - pub uid: uid_t, + uid: uid_t, /// GID (group ID) of the process - pub gid: gid_t, + gid: gid_t, +} + +impl UCred { + /// Gets UID (user ID) of the process. + pub fn uid(&self) -> uid_t { + self.uid + } + + /// Gets GID (group ID) of the process. + pub fn gid(&self) -> gid_t { + self.gid + } } #[cfg(any(target_os = "linux", target_os = "android"))] |