Struct kube_client::api::AttachedProcess
source · 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 !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