pub enum RedirectAction<T> {
Close(Fd),
Open(Fd, T, Permissions),
HereDoc(Fd, Vec<u8>),
}Expand description
Indicates what changes should be made to the environment as a result
of a successful Redirect evaluation.
Variants§
Close(Fd)
Indicates that a descriptor should be closed.
Open(Fd, T, Permissions)
Indicates that a descriptor should be opened with a given file handle and permissions.
HereDoc(Fd, Vec<u8>)
Indicates that the body of a heredoc should be asynchronously written to a file handle on a best effor basis (i.e. write as much of the body as possible but give up on appropriate errors such as broken pipes).
Implementations§
Source§impl<T> RedirectAction<T>
impl<T> RedirectAction<T>
Sourcepub fn apply<E>(self, env: &mut E) -> Result<()>where
E: ?Sized + AsyncIoEnvironment + FileDescEnvironment + FileDescOpener,
E::FileHandle: From<T> + From<E::OpenedFileHandle>,
E::IoHandle: From<E::FileHandle>,
pub fn apply<E>(self, env: &mut E) -> Result<()>where
E: ?Sized + AsyncIoEnvironment + FileDescEnvironment + FileDescOpener,
E::FileHandle: From<T> + From<E::OpenedFileHandle>,
E::IoHandle: From<E::FileHandle>,
Applies changes to a given environment as appropriate.
Trait Implementations§
Source§impl<T: Clone> Clone for RedirectAction<T>
impl<T: Clone> Clone for RedirectAction<T>
Source§fn clone(&self) -> RedirectAction<T>
fn clone(&self) -> RedirectAction<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for RedirectAction<T>
impl<T: Debug> Debug for RedirectAction<T>
Source§impl<T: PartialEq> PartialEq for RedirectAction<T>
impl<T: PartialEq> PartialEq for RedirectAction<T>
impl<T: Eq> Eq for RedirectAction<T>
impl<T> StructuralPartialEq for RedirectAction<T>
Auto Trait Implementations§
impl<T> Freeze for RedirectAction<T>where
T: Freeze,
impl<T> RefUnwindSafe for RedirectAction<T>where
T: RefUnwindSafe,
impl<T> Send for RedirectAction<T>where
T: Send,
impl<T> Sync for RedirectAction<T>where
T: Sync,
impl<T> Unpin for RedirectAction<T>where
T: Unpin,
impl<T> UnwindSafe for RedirectAction<T>where
T: UnwindSafe,
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