pub struct ProcessFdTable { /* private fields */ }Implementations§
Source§impl ProcessFdTable
impl ProcessFdTable
pub fn max_fds(&self) -> usize
pub fn available_fd_capacity(&self) -> usize
pub fn init_stdio( &mut self, stdin_desc: SharedFileDescription, stdout_desc: SharedFileDescription, stderr_desc: SharedFileDescription, )
pub fn init_stdio_with_types( &mut self, stdin_desc: SharedFileDescription, stdin_type: u8, stdout_desc: SharedFileDescription, stdout_type: u8, stderr_desc: SharedFileDescription, stderr_type: u8, )
pub fn open(&mut self, path: &str, flags: u32) -> FdResult<u32>
pub fn open_with_filetype( &mut self, path: &str, flags: u32, filetype: u8, ) -> FdResult<u32>
pub fn open_with_details( &mut self, path: &str, flags: u32, filetype: u8, lock_target: Option<FileLockTarget>, ) -> FdResult<u32>
pub fn open_with( &mut self, description: SharedFileDescription, filetype: u8, target_fd: Option<u32>, ) -> FdResult<u32>
pub fn open_pair_with_details( &mut self, first_path: &str, second_path: &str, status_flags: u32, fd_flags: u32, filetype: u8, ) -> FdResult<(u32, u32, SharedFileDescription, SharedFileDescription)>
pub fn transfer(&self, fd: u32) -> FdResult<TransferredFd>
Sourcepub fn create_transfer(
&self,
path: &str,
flags: u32,
filetype: u8,
) -> TransferredFd
pub fn create_transfer( &self, path: &str, flags: u32, filetype: u8, ) -> TransferredFd
Create an open-file-description transfer without consuming an fd slot.
SCM_RIGHTS queues descriptions, not temporary descriptors in the
sending process. Keeping this separate from open_with_details avoids
spuriously returning EMFILE when the sender’s descriptor table is full.
pub fn install_transferred( &mut self, transfers: &[TransferredFd], close_on_exec: bool, ) -> FdResult<Vec<u32>>
pub fn get(&self, fd: u32) -> Option<&FdEntry>
pub fn values(&self) -> Values<'_, u32, FdEntry> ⓘ
pub fn close(&mut self, fd: u32) -> bool
Sourcepub fn close_on_exec_fds(&self) -> Vec<u32>
pub fn close_on_exec_fds(&self) -> Vec<u32>
File descriptors that must be closed when the current process image is replaced by exec(2). The caller performs the closes through the kernel so pipe/socket lifecycle accounting receives the same notifications as an explicit close(2).
pub fn dup(&mut self, fd: u32) -> FdResult<u32>
pub fn dup_with_status_flags( &mut self, fd: u32, status_flags_override: Option<u32>, ) -> FdResult<u32>
pub fn dup2(&mut self, old_fd: u32, new_fd: u32) -> FdResult<()>
pub fn stat(&self, fd: u32) -> FdResult<FdStat>
pub fn fcntl(&mut self, fd: u32, command: u32, arg: u32) -> FdResult<u32>
pub fn fork(&self) -> Self
Sourcepub fn fork_preserving_cloexec(&self) -> Self
pub fn fork_preserving_cloexec(&self) -> Self
Clone this descriptor table at the fork half of a deferred exec.
Linux keeps FD_CLOEXEC descriptors across fork(2) so spawn file
actions can use them as sources. The exec half closes any descriptors
that remain marked after those actions have run.
pub fn len_for_exec(&self) -> usize
pub fn close_all(&mut self)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> Values<'_, u32, FdEntry> ⓘ
Trait Implementations§
Source§impl Clone for ProcessFdTable
impl Clone for ProcessFdTable
Source§fn clone(&self) -> ProcessFdTable
fn clone(&self) -> ProcessFdTable
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProcessFdTable
impl Debug for ProcessFdTable
Source§impl<'a> IntoIterator for &'a ProcessFdTable
impl<'a> IntoIterator for &'a ProcessFdTable
Auto Trait Implementations§
impl Freeze for ProcessFdTable
impl RefUnwindSafe for ProcessFdTable
impl Send for ProcessFdTable
impl Sync for ProcessFdTable
impl Unpin for ProcessFdTable
impl UnsafeUnpin for ProcessFdTable
impl UnwindSafe for ProcessFdTable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more