pub struct Console { /* private fields */ }Expand description
The console / shell component.
Implementations§
Source§impl Console
impl Console
pub fn new(title: impl Into<String>) -> Self
pub fn with_prompt(self, p: impl Into<String>) -> Self
pub fn with_cursor(self, c: Cursor) -> Self
Sourcepub fn push_line(&mut self, raw: impl AsRef<str>)
pub fn push_line(&mut self, raw: impl AsRef<str>)
Append a raw line (ANSI-parsed), dropping the oldest past max_lines.
pub fn set_input(&mut self, s: impl Into<String>)
pub fn line_count(&self) -> usize
Sourcepub fn advance(&mut self, dt: f32)
pub fn advance(&mut self, dt: f32)
Advance the scrollback animation (the injected clock; deterministic).
Sourcepub fn plain_text(&self) -> String
pub fn plain_text(&self) -> String
The plain-text scrollback (for copy/search).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Console
impl<'de> Deserialize<'de> for Console
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Facet for Console
impl Facet for Console
fn title(&self) -> &str
fn ui(&mut self, ui: &mut Ui)
fn state_json(&self) -> Value
Source§fn set_scale(&mut self, scale: f32)
fn set_scale(&mut self, scale: f32)
Set the uniform scale; clamp internally. Default no-op (not scalable).
Source§fn copy(&mut self) -> Option<String>
fn copy(&mut self) -> Option<String>
Clipboard hooks — see clipboard.rs. Defaults: nothing to give/take.
Returns the text to place on the clipboard (None = nothing copyable now).
Source§fn selection_json(&self) -> Value
fn selection_json(&self) -> Value
The current selection as JSON (also folded into
state_json by
convention). Null when nothing/none selectable.Source§fn cut(&mut self) -> Option<String>
fn cut(&mut self) -> Option<String>
Like
copy, but also removes the selection. Default delegates to copy.Source§fn as_any_mut(&mut self) -> Option<&mut (dyn Any + 'static)>
fn as_any_mut(&mut self) -> Option<&mut (dyn Any + 'static)>
Optional downcast handle for hosts that need typed access to a specific
facet living inside a
FacetDeck (e.g. a robot-UI driver clicking an
app-level control that must forward to a concrete component’s own API).
Defaulted to None so no existing facet has to change; a component opts in
by returning Some(self).Auto Trait Implementations§
impl Freeze for Console
impl RefUnwindSafe for Console
impl Send for Console
impl Sync for Console
impl Unpin for Console
impl UnsafeUnpin for Console
impl UnwindSafe for Console
Blanket Implementations§
impl<T> Allocation for T
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