Struct conch_runtime::env::atomic::FileDescEnv
[−]
[src]
pub struct FileDescEnv<T> { /* fields omitted */ }
An environment module for setting and getting shell file descriptors.
Uses Arc
internally. If Send
and Sync
is not required of the implementation,
see env::FileDescEnv
as a cheaper alternative.
Methods
impl<T> AtomicFileDescEnv<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 AtomicFileDescEnv<T>
[src]
fn eq(&self, __arg_0: &AtomicFileDescEnv<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: &AtomicFileDescEnv<T>) -> bool
[src]
This method tests for !=
.
impl<T: Eq> Eq for AtomicFileDescEnv<T>
[src]
impl<T: Debug> Debug for AtomicFileDescEnv<T>
[src]
impl<T> Default for AtomicFileDescEnv<T>
[src]
impl<T> Clone for AtomicFileDescEnv<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 AtomicFileDescEnv<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 AtomicFileDescEnv<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.