pub struct Console {
pub prompt: String,
pub history: Vec<HistoryLine>,
pub history_view_end: usize,
/* private fields */
}Expand description
Engine-independant parts of the in-game console.
Fields§
§prompt: StringThe current contents of the prompt.
Should always be kept in sync with what’s displayed in the UI.
history: Vec<HistoryLine>Input and output history.
You should prepend input lines with “> “ or something similar when displaying them.
history_view_end: usizeWhere we are in the history view when scrolling using page up and down keys.
This index is one past the last line to be displayed at the bottom so that you can use it as the high end of a range.
Implementations§
Source§impl Console
impl Console
Sourcepub fn history_back(&mut self)
pub fn history_back(&mut self)
Go back in command history.
Save the prompt so that users can go back in history, then come back to present and get what they typed back.
Sourcepub fn history_forward(&mut self)
pub fn history_forward(&mut self)
Go forward in command history.
Restore the saved prompt if get to the end.
Sourcepub fn history_scroll_up(&mut self, count: usize)
pub fn history_scroll_up(&mut self, count: usize)
Scroll up in the history view.
Sourcepub fn history_scroll_down(&mut self, count: usize)
pub fn history_scroll_down(&mut self, count: usize)
Scroll down in the history view.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Console
impl RefUnwindSafe for Console
impl Send for Console
impl Sync for Console
impl Unpin for Console
impl UnwindSafe for Console
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