pub struct Session {
pub connected: bool,
parser: Parser,
sb: Vec<u8>,
csi: Vec<u8>,
line: Vec<u8>,
pos: usize,
history: Vec<Vec<u8>>,
hist_idx: usize,
saved_line: Vec<u8>,
pub term: Term,
pub cwd: String,
pub color_forced: bool,
}Fields§
§connected: bool§parser: Parser§sb: Vec<u8>§csi: Vec<u8>§line: Vec<u8>§pos: usize§history: Vec<Vec<u8>>§hist_idx: usize§saved_line: Vec<u8>§term: Term§cwd: String§color_forced: boolTrue when the user forced a color mode with the color command.
Implementations§
Source§impl Session
impl Session
pub fn new() -> Self
pub fn history(&self) -> impl Iterator<Item = &[u8]>
Sourcepub fn send_negotiation(&self, out: &mut Out)
pub fn send_negotiation(&self, out: &mut Out)
Option negotiation (used when the client spoke before the probe won).
fn draw_prompt(&self, out: &mut Out)
fn new_prompt(&mut self, out: &mut Out)
Sourcepub fn feed(&mut self, out: &mut Out, bytes: &[u8]) -> bool
pub fn feed(&mut self, out: &mut Out, bytes: &[u8]) -> bool
Feed bytes received from the client. Returns false to disconnect.
fn feed_byte(&mut self, out: &mut Out, b: u8) -> bool
fn negotiate(&mut self, out: &mut Out, cmd: u8, opt: u8)
fn subnegotiation(&mut self)
Sourcepub fn apply_color(&self, out: &mut Out)
pub fn apply_color(&self, out: &mut Out)
Color mode currently in effect for command output and the prompt.
fn insert(&mut self, out: &mut Out, b: u8)
fn backspace(&mut self, out: &mut Out)
fn delete(&mut self, out: &mut Out)
fn kill_word(&mut self, out: &mut Out)
fn move_left(&mut self, out: &mut Out)
fn move_right(&mut self, out: &mut Out)
fn set_line(&mut self, out: &mut Out, new: Vec<u8>)
fn csi_key(&mut self, out: &mut Out, fin: u8)
fn tab(&mut self, out: &mut Out)
fn replace_tail(&mut self, out: &mut Out, start: usize, text: Vec<u8>)
fn submit(&mut self, out: &mut Out) -> bool
Auto Trait Implementations§
impl Forget for Session
impl Freeze for Session
impl Move for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
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