pub struct AdoptedIdentity { /* private fields */ }Expand description
A pid together with the start time and executable path that make it a name for exactly one process. See the module documentation.
Implementations§
Source§impl AdoptedIdentity
impl AdoptedIdentity
Sourcepub fn capture(pid: NonZeroU32) -> Result<Option<Self>>
pub fn capture(pid: NonZeroU32) -> Result<Option<Self>>
Reads the identity of pid. Ok(None) when no process has that pid. The caller is
responsible for pid naming the intended process at this moment (it was just spawned
by a launcher, or it was just read from the owner’s own record).
Sourcepub fn from_recorded(
pid: NonZeroU32,
start: StartToken,
exe: Option<PathBuf>,
) -> Self
pub fn from_recorded( pid: NonZeroU32, start: StartToken, exe: Option<PathBuf>, ) -> Self
Rebuilds an identity persisted earlier (a pid file that also records
start_token and exe).
pub fn pid(&self) -> u32
pub fn start_token(&self) -> StartToken
pub fn exe(&self) -> Option<&Path>
Sourcepub fn verify(&self) -> Result<IdentityCheck>
pub fn verify(&self) -> Result<IdentityCheck>
Whether the pid still names the remembered process.
Sourcepub fn signal(&self, signal: AdoptedSignal) -> Result<SignalResult>
pub fn signal(&self, signal: AdoptedSignal) -> Result<SignalResult>
Sends signal only if the pid still names the remembered process. Never signals this
process: that is InvalidInput.
Sourcepub fn descendants(&self) -> Result<Vec<AdoptedIdentity>>
pub fn descendants(&self) -> Result<Vec<AdoptedIdentity>>
The descendants of this process, parents before children, each with its own identity. Empty when this process is gone or the pid now names a different one. A child is accepted only if it did not start before its parent, so a stale parent link to a recycled pid adds nothing.