pub struct Capture { /* private fields */ }Expand description
Builder for capturing command output.
Implementations§
Source§impl Capture
impl Capture
Sourcepub fn accept_nonzero_exit(self) -> Self
pub fn accept_nonzero_exit(self) -> Self
Accept non-zero exit status instead of treating it as an error.
Sourcepub async fn bytes(self) -> Result<Vec<u8>, CommandError>
pub async fn bytes(self) -> Result<Vec<u8>, CommandError>
Execute the command and return captured output as bytes.
Sourcepub async fn string(self) -> Result<String, CommandError>
pub async fn string(self) -> Result<String, CommandError>
Execute the command and return captured output as a UTF-8 string.
Auto Trait Implementations§
impl Freeze for Capture
impl RefUnwindSafe for Capture
impl Send for Capture
impl Sync for Capture
impl Unpin for Capture
impl UnwindSafe for Capture
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