console-listener 0.2.0

A crate for listening to console input in a separate thread.
Documentation
  • Coverage
  • 85.71%
    6 out of 7 items documented4 out of 5 items with examples
  • Size
  • Source code size: 6.26 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.28 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Arto-O

NOTE: Use console_listener with an underscore instead of the dash to bring this crate into scope.

console-listener

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.

How to use it

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.

Notes

This crate is still in initial development so the public API might still change drastically.