Crates.io | pipedconsole |
lib.rs | pipedconsole |
version | 0.3.2 |
source | src |
created_at | 2021-06-08 16:35:07.399949 |
updated_at | 2023-02-01 15:16:49.00604 |
description | Easily manage multiple windows consoles from one single process. |
homepage | |
repository | https://github.com/Foxcirc/pipedconsole |
max_upload_size | |
id | 407866 |
size | 52,858 |
A rust crate for managing multiple consoles from one windows application.
Normaly a program running on windows can only use one console.
A process can be associated with only one console, so the AllocConsole function fails if the calling process already has a console.
From the microsoft docs.
This crate solves this problem by providing an abstraction over a worker process wich is controlled using named pipes.
You can use the Console
class to create a new console, after that
you can write to it or read a line.
use pipedconsole::Console;
let console = Console::new("My Console").expect("Failed to create a new console");
console.println("What is your name?").expect("Failed to call println"); // a seperate console window
let mut name = String::new();
console.read_line(&mut name).expect("Failed to read from the console");
println!("Your name is: {}", name); // main processe's console
Download the crate either directly through Cargo or visit crates.io. More documentation can be found on docs.rs.
std::io::Write
for console. This means the flush
method is now part of that trait.console_worker
executable.
It is easier to use and comes with auto detection for the executable.
Note: The documentation on the root page is slightly wrong in this version.