This is an example Rust program that demonstrates how to insert values 1-100 into a Redis list and then retrieve them and print them in reverse order.
To run this program, you will need to have Rust installed on your system. If you do not have Rust installed, you can download and install it from the official Rust website.
You will also need to have a Redis server running on your local machine or network. You can download and install Redis from the official Redis website.
To run the program, follow these steps:
- Clone this repository to your local machine:
git clone https://github.com/boriguen/rust-insert-read.git
- Navigate to the project directory:
cd rust-insert-read
- Install the Redis crate:
cargo update
- Build the project:
cargo build --release
- Run the program:
./target/release/rust-insert-read
If everything is working correctly, you should see the values 100-1 printed to the console.
Currently, the program has hardcoded Redis database params. If your Redis server is running on a different host or port, you can modify the connection string in the main()
function of the main.rs
file.
These connection details will be moved into ENV variables at some point.
This program is licensed under the MIT License. See the LICENSE file for details.