pub struct SocketCred(/* private fields */);
๐ฌThis is a nightly-only experimental API. (
unix_socket_ancillary_data
#76915)Available on (Android or Linux or Cygwin) 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 duplicate 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