Struct nix::spawn::PosixSpawnFileActions

source ·
pub struct PosixSpawnFileActions { /* private fields */ }
Expand description

A spawn file actions object. See posix_spawn_file_actions_t.

Implementations§

source§

impl PosixSpawnFileActions

source

pub fn init() -> Result<PosixSpawnFileActions>

Initialize the spawn file actions object. See posix_spawn_file_actions_init.

source

pub fn reinit(self) -> Result<PosixSpawnFileActions>

Reinitialize the spawn file actions object. This is a wrapper around posix_spawn_file_actions_destroy. followed by posix_spawn_file_actions_init.

source

pub fn add_dup2(&mut self, fd: RawFd, newfd: RawFd) -> Result<()>

source

pub fn add_open<P: ?Sized + NixPath>( &mut self, fd: RawFd, path: &P, oflag: OFlag, mode: Mode, ) -> Result<()>

Add an open action. See posix_spawn_file_actions_addopen.

source

pub fn add_close(&mut self, fd: RawFd) -> Result<()>

Add a close action. See posix_spawn_file_actions_addclose.

source

pub fn add_chdir<P: ?Sized + NixPath>(&mut self, path: &P) -> Result<()>

Add a chdir action. See posix_spawn_file_actions_addchdir.

source

pub fn add_fchdir(&mut self, fd: RawFd) -> Result<()>

Add an fchdir action. See posix_spawn_file_actions_addfchdir.

source

pub fn add_closefrom_np(&mut self, fd: RawFd) -> Result<()>

Add a closefrom action. The action closes all file descriptors with a value greater or equal to fd during spawn.

Note: This is a non-portable glibc extension

source

pub fn add_tcsetpgrp_np(&mut self, tc_fd: RawFd) -> Result<()>

Add a tcsetpgrp action. This action sets the process group of the foreground process group associated with the terminal tc_fd.

Note: This is a non-portable glibc extension.

Trait Implementations§

source§

impl Debug for PosixSpawnFileActions

source§

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

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

impl Drop for PosixSpawnFileActions

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

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.