pub struct SocketCred(ucred);
🔬This is a nightly-only experimental API. (
unix_socket_ancillary_data
#76915)Available on Unix only.
Expand description
Unix credential.
Tuple Fields§
§0: ucred
🔬This is a nightly-only experimental API. (
unix_socket_ancillary_data
#76915)Implementations§
source§impl SocketCred
impl SocketCred
sourcepub fn new() -> SocketCred
🔬This is a nightly-only experimental API. (unix_socket_ancillary_data
#76915)Available on Android or Linux only.
pub fn new() -> SocketCred
unix_socket_ancillary_data
#76915)Create a Unix credential struct.
PID, UID and GID is set to 0.
sourcepub fn set_pid(&mut self, pid: i32)
🔬This is a nightly-only experimental API. (unix_socket_ancillary_data
#76915)Available on Android or Linux only.
pub fn set_pid(&mut self, pid: i32)
unix_socket_ancillary_data
#76915)Set the PID.
sourcepub fn get_pid(&self) -> i32
🔬This is a nightly-only experimental API. (unix_socket_ancillary_data
#76915)Available on Android or Linux only.
pub fn get_pid(&self) -> i32
unix_socket_ancillary_data
#76915)Get the current PID.
sourcepub fn set_uid(&mut self, uid: u32)
🔬This is a nightly-only experimental API. (unix_socket_ancillary_data
#76915)Available on Android or Linux only.
pub fn set_uid(&mut self, uid: u32)
unix_socket_ancillary_data
#76915)Set the UID.
sourcepub fn get_uid(&self) -> u32
🔬This is a nightly-only experimental API. (unix_socket_ancillary_data
#76915)Available on Android or Linux only.
pub fn get_uid(&self) -> u32
unix_socket_ancillary_data
#76915)Get 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