Struct conch_runtime::env::FileDescEnv
[−]
[src]
pub struct FileDescEnv<T> { /* fields omitted */ }
An environment module for setting and getting shell file descriptors.
Uses Rc
internally. For a possible Send
and Sync
implementation,
see env::atomic::FileDescEnv
.
Methods
impl<T> FileDescEnv<T>
[src]
fn new() -> Self
[src]
Constructs a new environment with no open file descriptors.
fn with_process_stdio() -> Result<Self> where
T: From<FileDesc>,
[src]
T: From<FileDesc>,
Constructs a new environment and initializes it with duplicated stdio file descriptors or handles of the current process.
fn with_fds<I: IntoIterator<Item = (Fd, T, Permissions)>>(iter: I) -> Self
[src]
Constructs a new environment with a provided collection of provided
file descriptors in the form (shell_fd, handle, permissions)
.
Trait Implementations
impl<T: PartialEq> PartialEq for FileDescEnv<T>
[src]
fn eq(&self, __arg_0: &FileDescEnv<T>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &FileDescEnv<T>) -> bool
[src]
This method tests for !=
.
impl<T: Eq> Eq for FileDescEnv<T>
[src]
impl<T: Debug> Debug for FileDescEnv<T>
[src]
impl<T> Default for FileDescEnv<T>
[src]
impl<T> Clone for FileDescEnv<T>
[src]
fn clone(&self) -> Self
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T> SubEnvironment for FileDescEnv<T>
[src]
fn sub_env(&self) -> Self
[src]
Create a new sub-environment, which starts out idential to its parent, but any changes on the new environment will not be reflected on the parent. Read more
impl<T: Clone + Eq> FileDescEnvironment for FileDescEnv<T>
[src]
type FileHandle = T
A file handle (or wrapper) to associate with shell file descriptors.
fn file_desc(&self, fd: Fd) -> Option<(&Self::FileHandle, Permissions)>
[src]
Get the permissions and a handle associated with an opened file descriptor.
fn set_file_desc(
&mut self,
fd: Fd,
handle: Self::FileHandle,
perms: Permissions
)
[src]
&mut self,
fd: Fd,
handle: Self::FileHandle,
perms: Permissions
)
Associate a file descriptor with a given handle and permissions.
fn close_file_desc(&mut self, fd: Fd)
[src]
Treat the specified file descriptor as closed for the current environment.