Struct Pid

struct Pid(_)

Process identifier

Newtype pattern around pid_t (which is just alias). It prevents bugs caused by accidentally passing wrong value.

Implementations

impl Pid

const fn from_raw(pid: pid_t) -> Self

Creates Pid from raw pid_t.

fn this() -> Self

Returns PID of calling process

fn parent() -> Self

Returns PID of parent of calling process

const fn as_raw(self: Self) -> pid_t

Get the raw pid_t wrapped by self.

impl Clone for Pid

fn clone(self: &Self) -> Pid

impl Copy for Pid

impl Debug for Pid

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl Display for Pid

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl Eq for Pid

impl Freeze for Pid

impl Hash for Pid

fn hash<__H: $crate::hash::Hasher>(self: &Self, state: &mut __H)

impl Ord for Pid

fn cmp(self: &Self, other: &Pid) -> Ordering

impl PartialEq for Pid

fn eq(self: &Self, other: &Pid) -> bool

impl PartialOrd for Pid

fn partial_cmp(self: &Self, other: &Pid) -> Option<Ordering>

impl RefUnwindSafe for Pid

impl Send for Pid

impl StructuralPartialEq for Pid

impl Sync for Pid

impl Unpin for Pid

impl UnsafeUnpin for Pid

impl UnwindSafe for Pid

impl<T> Any for Pid

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Pid

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Pid

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for Pid

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for Pid

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for Pid

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T> ToString for Pid

fn to_string(self: &Self) -> String

impl<T, U> Into for Pid

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for Pid

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

impl<T, U> TryInto for Pid

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