Searched refs:buf (Results 1 – 4 of 4) sorted by relevance
18 pub buf: Rc<RefCell<Vec<u8>>>, field31 buf: Rc::clone(bytes), in new()38 self.buf = Rc::new(RefCell::new(Vec::new())); in init_before_readline()52 let len_to_end = self.buf.deref().borrow().len() - self.cursor; in insert()55 let mut buf = self.buf.deref().borrow_mut(); in insert() localVariable56 buf.splice(self.cursor..self.cursor, bytes.iter().cloned()); in insert()61 String::from_utf8(buf[self.cursor..].to_vec()).unwrap() in insert()80 let buf_len = self.buf.deref().borrow().len(); in delete()85 self.buf.deref().borrow_mut().drain(cursor..cursor + len); in delete()90 String::from_utf8(self.buf.deref().borrow()[self.cursor..].to_vec()).unwrap() in delete()[all …]
91 let command_bytes = self.printer.buf.borrow().clone(); in exec()178 let mut buf: [u8; 1] = [0]; in read_char() localVariable180 if std::io::stdin().read(&mut buf).is_ok() { in read_char()181 return buf[0]; in read_char()223 if self.printer.cursor < self.printer.buf.borrow().len() { in handle_funckey()241 self.history_commands.push(Rc::clone(&self.printer.buf)); in readline()262 let mut buf = self.printer.buf.deref().borrow().clone(); in readline() localVariable263 buf.truncate(self.printer.cursor); in readline()264 let str = String::from_utf8(buf.clone()).unwrap(); in readline()265 if buf.len() == 0 || buf.iter().all(|byte| *byte == b' ') { in readline()[all …]
35 let mut buf: Vec<u8> = Vec::new(); in read_env() localVariable36 file.read_to_end(&mut buf).unwrap(); in read_env()38 for str in String::from_utf8(buf).unwrap().split('\n') { in read_env()
186 let mut buf: Vec<u8> = Vec::new(); in shell_cmd_free() localVariable187 info_file.read_to_end(&mut buf).unwrap(); in shell_cmd_free()188 let str = String::from_utf8(buf).unwrap(); in shell_cmd_free()