pub struct SocketCred(_);
🔬This is a nightly-only experimental API. (
unix_socket_ancillary_data
#76915)Available on (Android or Linux) and Unix only.
Expand description
Unix 凭据。
Implementations§
source§impl SocketCred
impl SocketCred
sourcepub fn new() -> SocketCred
🔬This is a nightly-only experimental API. (unix_socket_ancillary_data
#76915)
pub fn new() -> SocketCred
unix_socket_ancillary_data
#76915)创建 Unix 凭据结构体。
PID、UID 和 GID 设置为 0.
sourcepub fn set_pid(&mut self, pid: pid_t)
🔬This is a nightly-only experimental API. (unix_socket_ancillary_data
#76915)
pub fn set_pid(&mut self, pid: pid_t)
unix_socket_ancillary_data
#76915)设置 PID。
sourcepub fn get_pid(&self) -> pid_t
🔬This is a nightly-only experimental API. (unix_socket_ancillary_data
#76915)
pub fn get_pid(&self) -> pid_t
unix_socket_ancillary_data
#76915)获取当前的 PID。
sourcepub fn set_uid(&mut self, uid: uid_t)
🔬This is a nightly-only experimental API. (unix_socket_ancillary_data
#76915)
pub fn set_uid(&mut self, uid: uid_t)
unix_socket_ancillary_data
#76915)设置 UID。
sourcepub fn get_uid(&self) -> uid_t
🔬This is a nightly-only experimental API. (unix_socket_ancillary_data
#76915)
pub fn get_uid(&self) -> uid_t
unix_socket_ancillary_data
#76915)获取当前的 UID。
Trait Implementations§
source§impl Clone for SocketCred
impl Clone for SocketCred
source§fn clone(&self) -> SocketCred
fn clone(&self) -> SocketCred
返回值的副本。 Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
从
source
执行复制分配。 Read moreAuto Trait Implementations§
impl RefUnwindSafe for SocketCred
impl Send for SocketCred
impl Sync for SocketCred
impl Unpin for SocketCred
impl UnwindSafe for SocketCred
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
从拥有的值中借用。 Read more