# Rust-Based Key-Value Store Tool ## Overview This tool is a simple yet powerful key-value store, implemented in Rust. It allows users to set, get, and delete key-value pairs, with each key stored in a separate file on disk. Inspired by Android's Shared Preferences, it supports different data types like `String`, `Integer`, and `Float`. ## Features - **Set, Get, Delete Operations**: Perform basic key-value operations. - **Type Checking**: Handles different data types, including strings, integers, and floats. - **File-Based Storage**: Each key-value pair is stored in a separate file for persistence. - **Command-Line Interface**: Easy to use with simple command-line arguments. ## Installation ### From crates.io ```bash cargo install kvstore ``` c ### From Source Ensure you have Rust and Cargo installed on your system. Follow these steps to install: 1. Clone the repository: ```bash git clone [repository-url] ``` 2. Navigate to the project directory: ```bash cd my_kv_store ``` 3. Build the project using Cargo: ```bash cargo build --release ``` ## Usage After building the project, you can run the tool using the Cargo run command followed by the operation you want to perform. ### Set a generic Key-Value Pair ```bash cargo run -- set [--type ] ``` - ``: The key for the value. - ``: The value to store. - ``: The type of the value (`String`, `Integer`, `Float`). Default is `String`. Using `set` will infer a type for the value. If you want to specify the value, you can use one of the following instead: - `setString` - `setInteger` - `setFloat` ### Get a Value ```bash cargo run -- get ``` - ``: The key of the value to retrieve. Using `get` will return the type as well as the value - something like `String:hello`. If you want to specify the value, you can use one of the following instead: - `getString` - `getInteger` - `getFloat` ### Delete a Key-Value Pair ```bash cargo run -- delete ``` - ``: The key of the value to delete. ## Contributing Contributions to this project are welcome! Feel free to fork the repository and submit pull requests. ## License This project is licensed under `The MIT License` - see the LICENSE file for details.