Giter Site home page Giter Site logo

rsedis's Introduction

rsedis

Build Status Build status

Redis re-implemented in Rust.

Why?

To learn Rust.

Use Cases

rsedis does not rely on UNIX-specific features. Windows users can run it as a replacement of Redis.

rsedis uses multiple threads which may be more useful in machines with multiple cores.

Prerequisites

Rust nightly.

Current Status

See TODO.md.

License

Copyright (c) 2015, Sebastian Waisbrot All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

rsedis's People

Contributors

badboy avatar eira-fransham avatar fedorkotov avatar gkorland avatar meteor-lsw avatar seppo0010 avatar shashitnak avatar yberreby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rsedis's Issues

using rustc 1.35.0

cant run cargo build

warning: unused import: libc::funcs::c95::ctype::isprint

compiling parser v0.1.0 ...... rsedis/parser
error[E0554].....
skiplist.0.2.10/src/lib.rs:26:35

What's the plan?

As we can see, your last commit was almost 3 years ago. So, what's the plan?

Are you still working on this?

Redis Streams: XADD, XRANGE, XREVRANGE

I'm using Redis for some time series logging on a Raspberry Pi, but I just had to compile Redis 5.0 from source for Streams.

It would be great if rsedis supported Streams with a short guide to embed the same functionality in my Rust program so I can drop Redis as a custom-build dependency :).

Good luck with your project! Looks cool

Unable to compile

Outputs the following error when I run cargo run

Updating registry `https://github.com/rust-lang/crates.io-index`
 Downloading skiplist v0.2.4
 Downloading time v0.1.26
 Downloading gcc v0.3.8
   Compiling libc v0.1.8
   Compiling gcc v0.3.8
   Compiling response v0.1.0 (file:///Workspace/rustlang/git/rsedis)
   Compiling parser v0.1.0 (file:///Workspace/rustlang/git/rsedis)
<std macros>:6:1: 6:32 error: the trait `core::convert::From<core::num::ParseFloatError>` is not implemented for the type `ParseError` [E0277]
<std macros>:6 $ crate:: convert:: From:: from ( err ) ) } } )
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<std macros>:1:1: 6:48 note: in expansion of try!
parser/src/lib.rs:77:39: 77:66 note: expansion site
<std macros>:6:1: 6:32 error: the trait `core::convert::From<core::num::ParseFloatError>` is not implemented for the type `ParseError` [E0277]
<std macros>:6 $ crate:: convert:: From:: from ( err ) ) } } )
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<std macros>:1:1: 6:48 note: in expansion of try!
parser/src/lib.rs:79:35: 79:57 note: expansion site
<std macros>:6:1: 6:32 error: the trait `core::convert::From<core::num::ParseFloatError>` is not implemented for the type `ParseError` [E0277]
<std macros>:6 $ crate:: convert:: From:: from ( err ) ) } } )
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<std macros>:1:1: 6:48 note: in expansion of try!
parser/src/lib.rs:85:19: 85:41 note: expansion site
error: aborting due to 3 previous errors
Build failed, waiting for other jobs to finish...
Could not compile `parser`.

To learn more, run the command again with --verbose.

Cannot split off at a nonexistent index

I am learning rust and the source code of rsedis is a good teaching material.But I found a BUG:

  pub fn ltrim(&mut self, _start: i64, _stop: i64) -> Result<(), OperationError> {
        let list = match *self {
            ValueList::Data(ref mut list) => {
                let len = list.len();
                let start = match normalize_position(_start, len) {
                    Ok(i) => i,
                    Err(g) => if !g { 0 } else {
                        list.split_off(len);
                        len
                    },
                };
                let stop = match normalize_position(_stop, len) {
                    Ok(i) => i,
                    Err(g) => if !g {
                        list.split_off(len);
                        0
                    } else { len },
                };
                list.split_off(stop + 1);
                list.split_off(start)
            }
        };
        *self = ValueList::Data(list);
        Ok(())
    }

This is a function of the struct ValueList in database/src/list.rs.
If _stop argument equal or greater than len , the value of stop will be len and stop + 1 will out of range.
If stop less than len and start greater than stop + 1 , the program will panic.

How did you do the implementation?

I am always curious on how people do the "conversion" from one language to another?
Did you take the original source code and translated it one file after another or did you take the concepts and try to implement it or another way?

Sorry for my curious mind. Thanks.

Benchmark

Do you have any benchmark between original Redis and your implementation?

Can not compile on windows

Can not compile on windows for x86_64-pc-windows-msvc target with VisualStudio 2019.

... almost 50k lines ommited ...
error: aborting due to 4550 previous errors

For more information about this error, try `rustc --explain E0412`.
error: Could not compile `kernel32-sys`.

(see full cargo output build.log.msvc.txt)

kernel32-sys crate is now obsolete and should be replaced with winapi.

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.