pub struct FileDescEnv<T> { /* private fields */ }Expand description
An environment module for setting and getting shell file descriptors.
Implementations§
Source§impl<T> FileDescEnv<T>
impl<T> FileDescEnv<T>
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Constructs a new environment with no open file descriptors, but with a specified capacity for storing open file descriptors.
Sourcepub fn with_process_stdio() -> Result<Self>
pub fn with_process_stdio() -> Result<Self>
Constructs a new environment and initializes it with duplicated stdio file descriptors or handles of the current process.
Sourcepub fn with_fds<I: IntoIterator<Item = (Fd, T, Permissions)>>(iter: I) -> Self
pub fn with_fds<I: IntoIterator<Item = (Fd, T, Permissions)>>(iter: I) -> Self
Constructs a new environment with a provided collection of provided
file descriptors in the form (shell_fd, handle, permissions).
Trait Implementations§
Source§impl<T> Clone for FileDescEnv<T>
impl<T> Clone for FileDescEnv<T>
Source§impl<T: Debug> Debug for FileDescEnv<T>
impl<T: Debug> Debug for FileDescEnv<T>
Source§impl<T> Default for FileDescEnv<T>
impl<T> Default for FileDescEnv<T>
Source§impl<T: Clone + Eq> FileDescEnvironment for FileDescEnv<T>
impl<T: Clone + Eq> FileDescEnvironment for FileDescEnv<T>
Source§type FileHandle = T
type FileHandle = T
A file handle (or wrapper) to associate with shell file descriptors.
Source§fn file_desc(&self, fd: Fd) -> Option<(&Self::FileHandle, Permissions)>
fn file_desc(&self, fd: Fd) -> Option<(&Self::FileHandle, Permissions)>
Get the permissions and a handle associated with an opened file descriptor.
Source§fn set_file_desc(
&mut self,
fd: Fd,
handle: Self::FileHandle,
perms: Permissions,
)
fn set_file_desc( &mut self, fd: Fd, handle: Self::FileHandle, perms: Permissions, )
Associate a file descriptor with a given handle and permissions.
Source§fn close_file_desc(&mut self, fd: Fd)
fn close_file_desc(&mut self, fd: Fd)
Treat the specified file descriptor as closed for the current environment.
Source§impl<T: PartialEq> PartialEq for FileDescEnv<T>
impl<T: PartialEq> PartialEq for FileDescEnv<T>
Source§impl<T> SubEnvironment for FileDescEnv<T>
impl<T> SubEnvironment for FileDescEnv<T>
impl<T: Eq> Eq for FileDescEnv<T>
impl<T> StructuralPartialEq for FileDescEnv<T>
Auto Trait Implementations§
impl<T> Freeze for FileDescEnv<T>
impl<T> RefUnwindSafe for FileDescEnv<T>where
T: RefUnwindSafe,
impl<T> Send for FileDescEnv<T>
impl<T> Sync for FileDescEnv<T>
impl<T> Unpin for FileDescEnv<T>
impl<T> UnwindSafe for FileDescEnv<T>where
T: RefUnwindSafe,
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
Mutably borrows from an owned value. Read more