Struct EventExec

Source
pub struct EventExec<'a> { /* private fields */ }
Available on macOS only.
Expand description

A process execution event.

Implementations§

Source§

impl<'a> EventExec<'a>

Source

pub fn target(&self) -> Process<'a>

The new process that is being executed.

Source

pub fn dyld_exec_path(&self) -> Option<&'a OsStr>

Available on crate feature macos_13_3_0 only.

The exec path passed up to dyld, before symlink resolution. This is the path argument to execve(2) or posix_spawn(2), or the interpreter from the shebang line for scripts run through the shell script image activator.

Present on version 7 and later.

Source

pub fn script(&self) -> Option<File<'a>>

Available on crate feature macos_10_15_1 only.

Script being executed by interpreter (if present) on version 2 and later, otherwise None.

Warning: This only work if a script was executed directly and not as an argument to the interpreter (e.g. ./foo.sh not /bin/sh ./foo.sh)

Source

pub fn cwd(&self) -> Option<File<'a>>

Available on crate feature macos_10_15_4 only.

Current working directory at exec time (if present) on version 3 and later, otherwise None.

Source

pub fn last_fd(&self) -> Option<i32>

Available on crate feature macos_11_0_0 only.

Highest open file descriptor after the exec completed (if present) on version 4 and later, otherwise None.

Source

pub fn arg_count(&self) -> u32

Get the number of arguments associated to the EventExec.

Source

pub fn env_count(&self) -> u32

Get the number of environment variables associated to the EventExec.

Source

pub fn fd_count(&self) -> u32

Available on crate feature macos_11_0_0 only.

Get the number of file descriptors associated to the EventExec.

Source

pub fn arg(&self, index: u32) -> Option<&'a OsStr>

Get the argument at the specified position on the associated EventExec.

Source

pub fn env(&self, index: u32) -> Option<&'a OsStr>

Get the environment variable at the specified position on the associated EventExec.

Source

pub fn fd(&self, index: u32) -> Option<Fd<'a>>

Available on crate feature macos_11_0_0 only.

Get the file descriptor at the specified position on the associated EventExec.

Source

pub fn args<'event>(&'event self) -> ExecArgs<'event, 'a>

Iterator over the arguments

Source

pub fn envs<'event>(&'event self) -> ExecEnvs<'event, 'a>

Iterator over the environment

Source

pub fn fds<'event>(&'event self) -> ExecFds<'event, 'a>

Available on crate feature macos_11_0_0 only.

Iterator over the file descriptors

Source

pub fn image_cputype(&self) -> Option<cpu_type_t>

Available on crate feature macos_13_0_0 only.

CPU type of the executable image which is being executed, present on version 6 or later.

Source

pub fn image_cpusubtype(&self) -> Option<cpu_subtype_t>

Available on crate feature macos_13_0_0 only.

CPU subtype of the executable image, present on version 6 or later.

Trait Implementations§

Source§

impl<'a> Debug for EventExec<'a>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'a> Hash for EventExec<'a>

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'a> PartialEq for EventExec<'a>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

const fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> Eq for EventExec<'a>

Source§

impl Send for EventExec<'_>

Source§

impl Sync for EventExec<'_>

Auto Trait Implementations§

§

impl<'a> Freeze for EventExec<'a>

§

impl<'a> RefUnwindSafe for EventExec<'a>

§

impl<'a> Unpin for EventExec<'a>

§

impl<'a> UnwindSafe for EventExec<'a>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T> AutoreleaseSafe for T
where T: ?Sized,