pub struct AttachedProcess { /* private fields */ }
Available on crate feature
client
only.Expand description
Represents an attached process in a container for attach
and exec
.
Provides access to stdin
, stdout
, and stderr
if attached.
Use AttachedProcess::join
to wait for the process to terminate.
Implementations§
Source§impl AttachedProcess
impl AttachedProcess
Sourcepub fn stdin(&mut self) -> Option<impl AsyncWrite + Unpin>
pub fn stdin(&mut self) -> Option<impl AsyncWrite + Unpin>
Async writer to stdin.
let mut stdin_writer = attached.stdin().unwrap();
stdin_writer.write(b"foo\n").await?;
Only available if AttachParams
had stdin
.
Sourcepub fn stdout(&mut self) -> Option<impl AsyncRead + Unpin>
pub fn stdout(&mut self) -> Option<impl AsyncRead + Unpin>
Async reader for stdout outputs.
let mut stdout_reader = attached.stdout().unwrap();
let mut buf = [0u8; 4];
stdout_reader.read_exact(&mut buf).await?;
Only available if AttachParams
had stdout
.
Sourcepub fn stderr(&mut self) -> Option<impl AsyncRead + Unpin>
pub fn stderr(&mut self) -> Option<impl AsyncRead + Unpin>
Async reader for stderr outputs.
let mut stderr_reader = attached.stderr().unwrap();
let mut buf = [0u8; 4];
stderr_reader.read_exact(&mut buf).await?;
Only available if AttachParams
had stderr
.
Sourcepub fn take_status(&mut self) -> Option<impl Future<Output = Option<Status>>>
pub fn take_status(&mut self) -> Option<impl Future<Output = Option<Status>>>
Take a future that resolves with any status object or when the sender is dropped.
Returns None
if called more than once.
Sourcepub fn terminal_size(&mut self) -> Option<Sender<TerminalSize>>
pub fn terminal_size(&mut self) -> Option<Sender<TerminalSize>>
Async writer to change the terminal size
let mut terminal_size_writer = attached.terminal_size().unwrap();
terminal_size_writer.send(TerminalSize{
height: 100,
width: 200,
}).await?;
Only available if AttachParams
had tty
.
Auto Trait Implementations§
impl Freeze for AttachedProcess
impl !RefUnwindSafe for AttachedProcess
impl Send for AttachedProcess
impl Sync for AttachedProcess
impl Unpin for AttachedProcess
impl !UnwindSafe for AttachedProcess
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more