pub struct Console<Ctx> { /* private fields */ }Implementations§
Source§impl<Ctx> Console<Ctx>where
Ctx: 'static,
impl<Ctx> Console<Ctx>where
Ctx: 'static,
pub fn new() -> Console<Ctx>
pub fn with_toggle_key(self, key: Key) -> Console<Ctx>
Sourcepub fn register<C>(&mut self, command: C)where
C: Command<Ctx> + 'static,
pub fn register<C>(&mut self, command: C)where
C: Command<Ctx> + 'static,
Silently replaces any existing command of the same name.
pub fn has_command(&self, name: &str) -> bool
Sourcepub fn bind(&mut self, key: Key, command_line: impl Into<String>)
pub fn bind(&mut self, key: Key, command_line: impl Into<String>)
No modifiers; fires only while the console is closed. Re-binding overwrites.
pub fn unbind(&mut self, key: Key)
pub fn open(&mut self)
pub fn close(&mut self)
pub fn toggle(&mut self)
pub fn is_open(&self) -> bool
pub fn detach(&mut self)
pub fn dock(&mut self)
pub fn is_detached(&self) -> bool
pub fn write(&mut self, line: HistoryLine)
pub fn set_status(&mut self, text: impl Into<String>)
pub fn toggle_key(&self) -> Key
pub fn history(&self) -> &VecDeque<HistoryLine>
pub fn input(&self) -> &str
Sourcepub fn input_mut(&mut self) -> &mut String
pub fn input_mut(&mut self) -> &mut String
An edit through this must be followed by Console::cancel_tab_cycle.
pub fn status(&self) -> &str
pub fn submit(&mut self)
pub fn clear_history(&mut self)
pub fn clear_input(&mut self)
pub fn cancel_tab_cycle(&mut self)
pub fn take_pending_focus(&mut self) -> bool
pub fn wants_persistent_focus(&self) -> bool
pub fn set_user_defocused(&mut self, defocused: bool)
pub fn take_pending_cursor_to_end(&mut self) -> bool
pub fn history_prev(&mut self)
pub fn history_next(&mut self)
pub fn tab_complete(&mut self)
Sourcepub fn tab_preview(&self) -> Option<String>
pub fn tab_preview(&self) -> Option<String>
Suffix of the first (sort-order) completion; what the next Tab inserts.
Sourcepub fn execute(&mut self, line: &str)
pub fn execute(&mut self, line: &str)
Runs a built-in on the spot; parks anything else for Console::drain_pending.
pub fn drain_pending(&mut self) -> Vec<String>
Trait Implementations§
Auto Trait Implementations§
impl<Ctx> Freeze for Console<Ctx>
impl<Ctx> !RefUnwindSafe for Console<Ctx>
impl<Ctx> !Send for Console<Ctx>
impl<Ctx> !Sync for Console<Ctx>
impl<Ctx> Unpin for Console<Ctx>
impl<Ctx> UnsafeUnpin for Console<Ctx>
impl<Ctx> !UnwindSafe for Console<Ctx>
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