Crates.io | rusty-redis |
lib.rs | rusty-redis |
version | 0.1.0 |
source | src |
created_at | 2023-07-22 08:10:45.731364 |
updated_at | 2023-07-22 08:10:45.731364 |
description | RustyRedis is a Redis written in Rust |
homepage | |
repository | https://github.com/sunray-ley/rusty-redis |
max_upload_size | |
id | 923100 |
size | 6,506 |
RustyRedis is a Redis written in Rust, including a Redis client and a Redis server.
Supports common Redis data structures such as strings, hash tables, lists, etc
Provides a complete set of Redis commands, including GET, SET, HGET, HSET, LPUSH, LPOP, etc
Implements client-server communication over TCP using an efficient networking library
Codebase is clean, readable, and maintainable
Make sure you have Rust programming language and Cargo package manager installed. Execute the following commands in the terminal to install:
cargo install rusty-redis
NOTICE: RustyRedis is still under active development and will soon be available.
To run RustyRedis as a Redis server, execute the following command:
rusty-redis-server
The server will listen for client connections on the default port 6379. You can also specify a different port number using command-line arguments.
To connect to the Redis server using the RustyRedis client, execute the following command:
rusty-redis-client
The client will prompt you to enter commands and display the command execution results.
RustyRedis provides a simple and easy-to-use API that you can directly use in your Rust projects. Here's a simple example:
use rusty_redis::client::RedisClient;
fn main() {
let mut client = RedisClient::new("127.0.0.1", 6379).unwrap();
// Set key-value pair
client.set("name", "John").unwrap();
// Get value by key
let name: Option<String> = client.get("name").unwrap();
println!("Name: {:?}", name);
// Execute Redis command
let response: String = client.command("PING").unwrap();
println!("Response: {}", response);
}
For more information on API usage, please refer to the API documentation.
Contributions to RustyRedis are welcome! If you have any suggestions or questions, please open an issue or pull request on GitHub.
RustyRedis is distributed under the MIT License. Please refer to the LICENSE file for more information.