Struct ubend::Chain [−][src]
pub struct Chain { /* fields omitted */ }
Represents a pipe chain.
Methods
impl Chain
[src]
impl Chain
pub fn kill_all(&mut self, sig: c_int) -> Result<(), KillError>
[src]
pub fn kill_all(&mut self, sig: c_int) -> Result<(), KillError>
Send signal sig
to all child processes.
pub fn new(pipes: Vec<Command>) -> Result<Self>
[src]
pub fn new(pipes: Vec<Command>) -> Result<Self>
Create a new pipe chain. This function is called by the [ubend!] macro.
pub fn stdin(&mut self) -> Option<File>
[src]
pub fn stdin(&mut self) -> Option<File>
Take ownership of stdin of the first process in the chain.
If the setup didn't create a pipe at the given location or the pipe was already taken this function returns None.
pub fn stdout(&mut self) -> Option<File>
[src]
pub fn stdout(&mut self) -> Option<File>
Take ownership of stdout of the last process in the chain.
If the setup didn't create a pipe at the given location or the pipe was already taken this function returns None.
pub fn stderr(&mut self) -> Option<File>
[src]
pub fn stderr(&mut self) -> Option<File>
Take ownership of stderr of the last process in the chain.
If the setup didn't create a pipe at the given location or the pipe was already taken this function returns None.
pub fn stdin_at(&mut self, index: usize) -> Option<File>
[src]
pub fn stdin_at(&mut self, index: usize) -> Option<File>
Take ownership of stdin of the process at index in the chain.
If the index is out of bounds or the setup didn't create a pipe at the given location or the pipe was already taken this function returns None.
pub fn stdout_at(&mut self, index: usize) -> Option<File>
[src]
pub fn stdout_at(&mut self, index: usize) -> Option<File>
Take ownership of stdout of the process at index in the chain.
If the index is out of bounds or the setup didn't create a pipe at the given location or the pipe was already taken this function returns None.
pub fn stderr_at(&mut self, index: usize) -> Option<File>
[src]
pub fn stderr_at(&mut self, index: usize) -> Option<File>
Take ownership of stderr of the process at index in the chain.
If the index is out of bounds or the setup didn't create a pipe at the given location or the pipe was already taken this function returns None.
pub fn children(&self) -> &[Child]
[src]
pub fn children(&self) -> &[Child]
pub fn children_mut(&mut self) -> &mut [Child]
[src]
pub fn children_mut(&mut self) -> &mut [Child]
pub fn wait_all(&mut self) -> Vec<WaitResult>
[src]
pub fn wait_all(&mut self) -> Vec<WaitResult>
Wait for all child processes to finish.
pub fn wait_last(&mut self) -> WaitResult
[src]
pub fn wait_last(&mut self) -> WaitResult
Wait for the last child process to finish.
pub fn output(self) -> Result<Output, OutputError>
[src]
pub fn output(self) -> Result<Output, OutputError>
Close stdin of the first child process and read stdout and stderr of the last child process (if possible) and wait for the last child process to finish.