pub struct Console { /* private fields */ }Expand description
Complete console I/O facade.
Integrates input reading and output rendering for terminal interaction.
Implementations§
Source§impl Console
impl Console
Sourcepub fn new(input_handle: IOInputHandle, output_handle: IOOutputHandle) -> Self
pub fn new(input_handle: IOInputHandle, output_handle: IOOutputHandle) -> Self
Creates a new console.
Sourcepub fn verbose(
input_handle: IOInputHandle,
output_handle: IOOutputHandle,
) -> Self
pub fn verbose( input_handle: IOInputHandle, output_handle: IOOutputHandle, ) -> Self
Creates a console with verbose output.
Sourcepub fn set_verbose(&mut self, verbose: bool)
pub fn set_verbose(&mut self, verbose: bool)
Sets verbose mode for the renderer.
Sourcepub async fn run(self)
pub async fn run(self)
Runs the console.
This starts:
- Input reader task (reads stdin, sends to IOInputHandle)
- Renderer task (receives from IOOutputHandle, renders to terminal)
Returns when both tasks complete (typically when the channel is closed).
Sourcepub fn spawn(self) -> (JoinHandle<()>, JoinHandle<()>)
pub fn spawn(self) -> (JoinHandle<()>, JoinHandle<()>)
Spawns the console as background tasks.
Returns handles to the spawned tasks.
§Returns
A tuple of (input_task, renderer_task) JoinHandles.
Sourcepub fn split(self) -> (ConsoleInputReader, ConsoleRenderer, IOOutputHandle)
pub fn split(self) -> (ConsoleInputReader, ConsoleRenderer, IOOutputHandle)
Splits the console into its components.
Useful when you need separate control over input and output.
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 UnsafeUnpin 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