Crates.io | console-listener |
lib.rs | console-listener |
version | 0.2.0 |
source | src |
created_at | 2021-01-21 09:11:11.917591 |
updated_at | 2021-01-23 10:51:25.484968 |
description | A crate for listening to console input in a separate thread. |
homepage | |
repository | |
max_upload_size | |
id | 344802 |
size | 6,626 |
NOTE: Use console_listener
with an underscore instead of the dash to bring this crate into scope.
console-listener is a crate for listening to console input in a separate thread. It is very useful for listen for a stop command in an otherwise infinitely looping program. console_listener
includes the Listener
struct, used to listen for a specified string to be typed to the console.
Use console_listener::listener::Listener
to bring the struct to scope. Use Listener::new(key: &str)
to create a new Listener
instance. See whether the specified string has been heard using heard_key()
Check the documentation for more info on the implementations.
This crate is still in initial development so the public API might still change drastically.