#[repr(transparent)]pub struct Pid(_);
Available on crate feature
process
only.Expand description
pid_t
—A non-zero Unix process ID.
This is a pid, and not a pidfd. It is not a file descriptor, and the process it refers to could disappear at any time and be replaced by another, unrelated, process.
Implementations
sourceimpl Pid
impl Pid
sourcepub const INIT: Self = Self(
// Safety: The init process' pid is always valid.
unsafe { RawNonZeroPid::new_unchecked(1) },
)
pub const INIT: Self = Self( // Safety: The init process' pid is always valid. unsafe { RawNonZeroPid::new_unchecked(1) }, )
A Pid
corresponding to the init process (pid 1).
sourcepub const unsafe fn from_raw_nonzero(raw: RawNonZeroPid) -> Self
pub const unsafe fn from_raw_nonzero(raw: RawNonZeroPid) -> Self
Converts a known non-zero RawPid
into a Pid
.
Safety
raw
must be the value of a valid Unix process ID. It must not be
zero.
sourcepub fn from_child(child: &Child) -> Self
pub fn from_child(child: &Child) -> Self
Creates a Pid
holding the ID of the given child process.
sourcepub const fn as_raw_nonzero(self) -> RawNonZeroPid
pub const fn as_raw_nonzero(self) -> RawNonZeroPid
Converts a Pid
into a RawNonZeroPid
.
Trait Implementations
impl Copy for Pid
impl Eq for Pid
impl StructuralEq for Pid
impl StructuralPartialEq for Pid
Auto Trait Implementations
impl RefUnwindSafe for Pid
impl Send for Pid
impl Sync for Pid
impl Unpin for Pid
impl UnwindSafe for Pid
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more