struct-input
A Rust crate for easy CLI input mapping to structs.
struct-input provides a StructInput trait that can be derived for any struct. This trait allows you to easily read CLI input and map it to the fields of your struct.
Features
- Easy to use derive macro for the
StructInputtrait. - Supports reading strings, integers, and optional strings.
- Customizable input prompts.
Usage
Add struct-input and struct-input-derive to your Cargo.toml:
[]
= "0.1.2"
Then, derive the StructInput trait for your struct:
use StructInput;
License
This project is licensed under the MIT License - see the LICENSE file for details.