pub struct Out {
pub fd: usize,
buf: Vec<u8>,
pub failed: bool,
pub color: ColorMode,
redirect: Option<usize>,
pub pending: Vec<u8>,
pub interrupted: bool,
pub peer_closed: bool,
poll_tick: u32,
}Fields§
§fd: usize§buf: Vec<u8>§failed: boolSet once a network write failed: commands should stop producing output.
color: ColorMode§redirect: Option<usize>When set, output goes (raw) to this file fd instead of the socket.
pending: Vec<u8>Raw bytes received from the client while a command was running.
interrupted: boolCtrl-C seen while a command was running.
peer_closed: bool§poll_tick: u32Implementations§
Source§impl Out
impl Out
pub fn new(fd: usize) -> Self
pub fn set_redirect(&mut self, fd: Option<usize>)
pub fn redirected(&self) -> bool
Sourcepub fn stop(&mut self) -> bool
pub fn stop(&mut self) -> bool
True if output should stop (client gone, write failed or Ctrl-C).
Sourcefn poll_input(&mut self)
fn poll_input(&mut self)
Cheaply look for Ctrl-C (and stash anything else as type-ahead).
pub fn flush(&mut self)
fn push(&mut self, b: u8)
fn byte(&mut self, b: u8)
Sourcepub fn raw(&mut self, bytes: &[u8])
pub fn raw(&mut self, bytes: &[u8])
Raw protocol bytes (telnet commands, escape sequences): no translation.
Sourcepub fn data(&mut self, bytes: &[u8])
pub fn data(&mut self, bytes: &[u8])
File content: control characters (including ESC) are neutralised so a binary file cannot corrupt the terminal. Redirected output is raw.
pub fn style(&mut self, s: Style)
Trait Implementations§
Auto Trait Implementations§
impl Forget for Out
impl Freeze for Out
impl Move for Out
impl RefUnwindSafe for Out
impl Send for Out
impl Sync for Out
impl Unpin for Out
impl UnsafeUnpin for Out
impl UnwindSafe for Out
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