pub struct SocketCred(/* private fields */);
🔬This is a nightly-only experimental API. (
unix_socket_ancillary_data
#76915)Available on (Android or Linux) and Unix only.
Expand description
Unix credential.
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)Creates a Unix credential struct.
PID, UID and GID is set to 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)Set the 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)Gets the current 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)Set the 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)Gets the current UID.
Trait Implementations§
Source§impl Clone for SocketCred
impl Clone for SocketCred
Source§fn clone(&self) -> SocketCred
fn clone(&self) -> SocketCred
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for SocketCred
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
Mutably borrows from an owned value. Read more