pub struct ShellStream { /* private fields */ }Expand description
A running shell v2 command whose packets are read as they arrive.
Implementations§
Source§impl ShellStream
impl ShellStream
Sourcepub fn read_packet(&mut self) -> Result<Option<ShellPacket>>
pub fn read_packet(&mut self) -> Result<Option<ShellPacket>>
The next packet, or None once the command has ended and the stream closed.
Sourcepub fn write_stdin(&mut self, data: &[u8]) -> Result<()>
pub fn write_stdin(&mut self, data: &[u8]) -> Result<()>
Writes data to the command’s standard input.
Sourcepub fn close_stdin(&mut self) -> Result<()>
pub fn close_stdin(&mut self) -> Result<()>
Closes the command’s standard input.
Sourcepub fn set_read_timeout(&mut self, timeout: Option<Duration>) -> Result<()>
pub fn set_read_timeout(&mut self, timeout: Option<Duration>) -> Result<()>
Replaces the deadline for each read; None waits indefinitely.
Sourcepub fn finish(self) -> Result<ShellOutput>
pub fn finish(self) -> Result<ShellOutput>
Reads the remaining packets and returns everything the command wrote from now on, with its exit status.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ShellStream
impl RefUnwindSafe for ShellStream
impl Send for ShellStream
impl Sync for ShellStream
impl Unpin for ShellStream
impl UnsafeUnpin for ShellStream
impl UnwindSafe for ShellStream
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request