Skip to main contentCrate input_py
Source - config
- Configuration constants for the input_py library and demo application.
All hardcoded values should be defined here to maintain code maintainability.
- BufReaderInput
- Generic reader from BufRead (for testing)
- GenericWriter
- Generic writer to Write (for testing)
- StdinReader
- Standard stdin implementation
- StdoutWriter
- Standard stdout implementation
- InputError
- Errors that can occur during input operations
- InputReader
- Trait for abstracting input operations (enables testing)
- OutputWriter
- Trait for abstracting output operations (enables testing)
- input
- Reads a line of input from stdin with a prompt, similar to Python’s input() function.
- input_trim
- Reads a line of input with configurable trimming behavior.
- input_with_default
- Reads a line of input with a default value if nothing is entered.
- process_input
- Process input string based on options
This is a pure function that can be tested independently
- read_input_with_io
- Internal helper function to read input with various options
This version accepts generic reader/writer for testing