# Struct std::os::unix::net::SocketCred
[−][src]

    pub struct SocketCred(_);

🔬 This is a nightly-only experimental API. (`unix_socket_ancillary_data` #76915)
This is supported on Unix only.
Expand description

Unix credential.

## Implementations

[src]

### impl SocketCred

[src]

#### pub fn new() -> SocketCred

🔬 This is a nightly-only experimental API. (`unix_socket_ancillary_data` #76915)
This is supported on Android or DragonFly BSD or Emscripten or FreeBSD or Linux or NetBSD or OpenBSD only.

Create a Unix credential struct.

PID, UID and GID is set to 0.

[src]

#### pub fn set_pid(&mut self, pid: pid_t)

🔬 This is a nightly-only experimental API. (`unix_socket_ancillary_data` #76915)
This is supported on Android or DragonFly BSD or Emscripten or FreeBSD or Linux or NetBSD or OpenBSD only.

Set the PID.

[src]

#### pub fn get_pid(&self) -> pid_t

🔬 This is a nightly-only experimental API. (`unix_socket_ancillary_data` #76915)
This is supported on Android or DragonFly BSD or Emscripten or FreeBSD or Linux or NetBSD or OpenBSD only.

Get the current PID.

[src]

#### pub fn set_uid(&mut self, uid: uid_t)

🔬 This is a nightly-only experimental API. (`unix_socket_ancillary_data` #76915)
This is supported on Android or DragonFly BSD or Emscripten or FreeBSD or Linux or NetBSD or OpenBSD only.

Set the UID.

[src]

#### pub fn get_uid(&self) -> uid_t

🔬 This is a nightly-only experimental API. (`unix_socket_ancillary_data` #76915)
This is supported on Android or DragonFly BSD or Emscripten or FreeBSD or Linux or NetBSD or OpenBSD only.

Get the current UID.

[src]

#### pub fn set_gid(&mut self, gid: gid_t)

🔬 This is a nightly-only experimental API. (`unix_socket_ancillary_data` #76915)
This is supported on Android or DragonFly BSD or Emscripten or FreeBSD or Linux or NetBSD or OpenBSD only.

Set the GID.

[src]

#### pub fn get_gid(&self) -> gid_t

🔬 This is a nightly-only experimental API. (`unix_socket_ancillary_data` #76915)
This is supported on Android or DragonFly BSD or Emscripten or FreeBSD or Linux or NetBSD or OpenBSD only.

Get the current GID.

## Trait Implementations

[src]

### impl Clone for SocketCred

This is supported on Android or DragonFly BSD or Emscripten or FreeBSD or Linux or NetBSD or OpenBSD only.
[src]

#### fn clone(&self) -> SocketCred

Returns a copy of the value. Read more

1.0.0[src]

#### fn clone_from(&mut self, source: &Self)

Performs copy-assignment from `source`. Read more

## Auto Trait Implementations

### impl RefUnwindSafe for SocketCred

### impl Send for SocketCred

### impl Sync for SocketCred

### impl Unpin for SocketCred

### impl UnwindSafe for SocketCred

## Blanket Implementations

[src]

### impl<T> Any for T where
T: 'static + ?Sized,

[src]

#### pub fn type_id(&self) -> TypeId

Gets the `TypeId` of `self`. Read more

[src]

### impl<T> Borrow<T> for T where
T: ?Sized,

[src]

#### pub fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more

[src]

### impl<T> BorrowMut<T> for T where
T: ?Sized,

[src]

#### pub fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more

[src]

### impl<T> From<T> for T

[src]

#### pub fn from(t: T) -> T

Performs the conversion.

[src]

### impl<T, U> Into<U> for T where
U: From<T>,

[src]

#### pub fn into(self) -> U

Performs the conversion.

[src]

### impl<T> ToOwned for T where
T: Clone,

#### type Owned = T

The resulting type after obtaining ownership.

[src]

#### pub fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more

[src]

#### pub fn clone_into(&self, target: &mut T)

🔬 This is a nightly-only experimental API. (`toowned_clone_into` #41263)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

[src]

### impl<T, U> TryFrom<U> for T where
U: Into<T>,

#### type Error = Infallible

The type returned in the event of a conversion error.

[src]

#### pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.

[src]

### impl<T, U> TryInto<U> for T where
U: TryFrom<T>,

#### type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

[src]

#### pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.