pub struct DevConsole {
pub filter: ConsoleFilter,
pub registry: CommandRegistry,
pub state: ConsoleState,
pub history: CommandHistory,
pub complete: CommandAutoComplete,
pub input_buffer: String,
pub cursor_visible: bool,
pub scroll_offset: usize,
/* private fields */
}Expand description
The developer console: log viewer + command input.
Fields§
§filter: ConsoleFilter§registry: CommandRegistry§state: ConsoleState§history: CommandHistory§complete: CommandAutoComplete§input_buffer: StringCurrent text in the input field.
cursor_visible: boolBlinking cursor state.
scroll_offset: usizeHow many lines we’ve scrolled back from the bottom.
Implementations§
Source§impl DevConsole
impl DevConsole
pub fn new() -> Self
pub fn log(&mut self, level: LogLevel, text: impl Into<String>)
pub fn trace(&mut self, text: impl Into<String>)
pub fn debug(&mut self, text: impl Into<String>)
pub fn info(&mut self, text: impl Into<String>)
pub fn warn(&mut self, text: impl Into<String>)
pub fn error(&mut self, text: impl Into<String>)
pub fn fatal(&mut self, text: impl Into<String>)
pub fn lines(&self) -> impl Iterator<Item = &ConsoleLine>
pub fn line_count(&self) -> usize
pub fn clear_log(&mut self)
pub fn push_char(&mut self, c: char)
pub fn pop_char(&mut self)
pub fn clear_input(&mut self)
Sourcepub fn submit(&mut self) -> CommandOutput
pub fn submit(&mut self) -> CommandOutput
Submit the current input buffer as a command.
Sourcepub fn tab_complete(&mut self)
pub fn tab_complete(&mut self)
Attempt tab-completion on the current input.
pub fn history_up(&mut self)
pub fn history_down(&mut self)
pub fn scroll_up(&mut self, lines: usize)
pub fn scroll_down(&mut self, lines: usize)
pub fn scroll_to_bottom(&mut self)
pub fn tick(&mut self, dt: f32)
Sourcepub fn drain_sink(&mut self, sink: &ConsoleSink)
pub fn drain_sink(&mut self, sink: &ConsoleSink)
Drain a ConsoleSink into this console.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DevConsole
impl !RefUnwindSafe for DevConsole
impl Send for DevConsole
impl Sync for DevConsole
impl Unpin for DevConsole
impl UnsafeUnpin for DevConsole
impl !UnwindSafe for DevConsole
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.