GithubHelp home page GithubHelp logo

steveklabnik / redis-rs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from redis-rs/redis-rs

0.0 2.0 0.0 880 KB

Redis library for rust

Home Page: http://mitsuhiko.github.io/redis-rs/

License: Other

Rust 99.60% Shell 0.40%

redis-rs's Introduction

redis-rs

Build Status

Redis-rs is a high level redis library for rust. It provides convenient access to all redis functionality through a very flexible but low-level API. It uses a customizable type conversion trait so that any operation can return results in just the type you are expecting. This makes for a very pleasant development experience.

The crate is called redis and you can depend on it via cargo:

[dependencies.redis]
git = "https://github.com/mitsuhiko/redis-rs.git"

Documentation on the library can be found at mitsuhiko.github.io/redis-rs.

Basic Operation

To open a connection you need to create a client and then to fetch a connection from it. In the future there will be a connection pool for those, currently each connection is separate and not pooled.

Many commands are implemented through the Commands trait but manual command creation is also possible.

extern crate redis;
use redis::Commands;

fn main() {
    let client = redis::Client::open("redis://127.0.0.1/").unwrap();
    let con = client.get_connection();
    assert_eq!(con.set("my_key", 42i), Ok(()));
    assert_eq!(con.get("my_key"), Ok(42i));
}

Development

If you want to develop on the library there are a few commands provided by the makefile:

To build:

$ make

To test:

$ make test

To run benchmarks:

$ make bench

To build the docs:

$ make docs

redis-rs's People

Contributors

ajtulloch avatar badboy avatar blackbeam avatar jedisct1 avatar locks avatar mitsuhiko avatar reisen avatar steveklabnik avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.