├── rustfmt.toml ├── .gitignore ├── Makefile ├── .travis.yml ├── Cargo.toml ├── README.md ├── src ├── lib.rs ├── types.rs └── commands.rs ├── tests ├── support │ └── mod.rs └── test_streams.rs ├── LICENSE └── Cargo.lock /rustfmt.toml: -------------------------------------------------------------------------------- 1 | use_try_shorthand = true 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | **/*.rs.bk 3 | .DS_Store -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: test-all doc fmt 2 | 3 | fmt: 4 | cargo +nightly fmt 5 | 6 | doc: 7 | cargo doc --no-deps --jobs=10 8 | 9 | test-all: 10 | RUST_BACKTRACE=true REDISRS_SERVER_TYPE=tcp cargo test -- --nocapture -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: rust 2 | 3 | rust: 4 | - stable 5 | 6 | cache: cargo 7 | 8 | addons: 9 | apt: 10 | packages: 11 | - redis-server 12 | 13 | script: 14 | - make test-all 15 | - | 16 | rustup component add rustfmt 17 | cargo fmt --all -- --check 18 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "redis-streams" 3 | description = "Redis streams commands" 4 | version = "0.1.1" 5 | authors = ["Greg Melton "] 6 | readme = "README.md" 7 | keywords = ["redis", "streams", "database"] 8 | repository = "https://github.com/grippy/redis-streams-rs.git" 9 | # documentation = "" 10 | categories = [] 11 | license = "MIT" 12 | edition = "2018" 13 | 14 | [lib] 15 | name = "redis_streams" 16 | path = "src/lib.rs" 17 | 18 | [dependencies] 19 | redis = "0.16.0" 20 | 21 | [dev-dependencies] 22 | rand = "0.7.3" 23 | net2 = "0.2.34" 24 | futures = "0.3.5" 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Note 2 | 3 | This project will be archived soon. All of the functionality here was [rolled into redis-rs](https://github.com/mitsuhiko/redis-rs/pull/319). Thanks @Terkwood for making this happen! 4 | 5 | # redis-streams-rs 6 | 7 | [![Build Status](https://travis-ci.org/grippy/redis-streams-rs.svg?branch=master)](https://travis-ci.org/grippy/redis-streams-rs) 8 | 9 | Implements the redis stream trait for `redis-rs` Rust client. This currently requires running code from `redis-rs` master (still waiting on a release to be cut and pushed up to [Crates.io](https://crates.io/crates/redis)). 10 | 11 | ## Usage 12 | 13 | To use `redis-streams-rs`, add this to your `Cargo.toml`: 14 | 15 | ```toml 16 | [dependencies] 17 | redis-streams = "0.1.0" 18 | ``` 19 | 20 | ## See redis-rs for details 21 | [![Build Status](https://travis-ci.org/mitsuhiko/redis-rs.svg?branch=master)](https://travis-ci.org/mitsuhiko/redis-rs) 22 | 23 | - [Source](https://github.com/mitsuhiko/redis-rs) 24 | - [Docs](https://mitsuhiko.github.io/redis-rs/redis/) 25 | 26 | # Docs 27 | 28 | run `make doc` to read the documentation. 29 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | //! `redis-streams-rs` exposes the [Redis Stream](https://redis.io/commands#stream) 2 | //! functionality as a Trait on top of [`redis-rs`](https://github.com/mitsuhiko/redis-rs). 3 | //! 4 | //! The crate is called `redis_streams`. 5 | //! 6 | //! In order to you use this crate, you'll first want to add it as a github 7 | //! dependency (until I have a chance to publish on crates.io). 8 | //! 9 | //! ```ini 10 | //! [dependencies.redis_streams] 11 | //! git = "https://github.com/grippy/redis-streams-rs.git" 12 | //! ``` 13 | //! 14 | //! From here, just unlock the streaming commands prior to instantiating client connections. 15 | //! 16 | //! ```no_run 17 | //! use redis_streams::{client_open,Connection,StreamCommands}; 18 | //! let client = client_open("redis://127.0.0.1/0").unwrap(); 19 | //! let mut con = client.get_connection().unwrap(); 20 | //! ``` 21 | //! 22 | //! This crate also exposes all top-level `redis-rs` types. 23 | //! To pick up all `redis-rs` Commands, just use the `Commands` trait. 24 | //! 25 | //! ```no_run 26 | //! use redis_streams::{Commands}; 27 | //! ``` 28 | //! 29 | #![deny(non_camel_case_types)] 30 | 31 | #[doc(hidden)] 32 | pub use redis::{ 33 | Client, Commands, Connection, ErrorKind, FromRedisValue, RedisError, RedisResult, ToRedisArgs, 34 | Value, 35 | }; 36 | 37 | pub use crate::commands::StreamCommands; 38 | 39 | pub use crate::types::{ 40 | // stream types 41 | StreamClaimOptions, 42 | StreamClaimReply, 43 | StreamId, 44 | StreamInfoConsumer, 45 | StreamInfoConsumersReply, 46 | StreamInfoGroup, 47 | StreamInfoGroupsReply, 48 | StreamInfoStreamReply, 49 | StreamKey, 50 | StreamMaxlen, 51 | StreamPendingCountReply, 52 | StreamPendingData, 53 | StreamPendingId, 54 | StreamPendingReply, 55 | StreamRangeReply, 56 | StreamReadOptions, 57 | StreamReadReply, 58 | }; 59 | 60 | mod commands; 61 | mod types; 62 | 63 | /// Curry `redis::Client::open` calls. 64 | /// 65 | pub fn client_open(params: T) -> redis::RedisResult { 66 | redis::Client::open(params) 67 | } 68 | -------------------------------------------------------------------------------- /tests/support/mod.rs: -------------------------------------------------------------------------------- 1 | // This file is mostly a direct copy of this file in redis-rs. 2 | // all the async code has been removed for now... 3 | // https://github.com/mitsuhiko/redis-rs/blob/master/tests/support/mod.rs 4 | 5 | #![allow(dead_code)] 6 | 7 | extern crate net2; 8 | extern crate rand; 9 | 10 | use redis; 11 | 12 | use std::env; 13 | use std::fs; 14 | use std::process; 15 | use std::thread::sleep; 16 | use std::time::Duration; 17 | 18 | use std::path::PathBuf; 19 | 20 | #[derive(PartialEq)] 21 | enum ServerType { 22 | Tcp, 23 | Unix, 24 | } 25 | 26 | pub struct RedisServer { 27 | pub process: process::Child, 28 | addr: redis::ConnectionAddr, 29 | } 30 | 31 | impl ServerType { 32 | fn get_intended() -> ServerType { 33 | match env::var("REDISRS_SERVER_TYPE") 34 | .ok() 35 | .as_ref() 36 | .map(|x| &x[..]) 37 | { 38 | Some("tcp") => ServerType::Tcp, 39 | Some("unix") => ServerType::Unix, 40 | val => { 41 | panic!("Unknown server type {:?}", val); 42 | } 43 | } 44 | } 45 | } 46 | 47 | impl RedisServer { 48 | pub fn new() -> RedisServer { 49 | let server_type = ServerType::get_intended(); 50 | let mut cmd = process::Command::new("redis-server"); 51 | cmd.stdout(process::Stdio::null()) 52 | .stderr(process::Stdio::null()); 53 | 54 | let addr = match server_type { 55 | ServerType::Tcp => { 56 | // this is technically a race but we can't do better with 57 | // the tools that redis gives us :( 58 | let listener = net2::TcpBuilder::new_v4() 59 | .unwrap() 60 | .reuse_address(true) 61 | .unwrap() 62 | .bind("127.0.0.1:0") 63 | .unwrap() 64 | .listen(1) 65 | .unwrap(); 66 | let server_port = listener.local_addr().unwrap().port(); 67 | cmd.arg("--port") 68 | .arg(server_port.to_string()) 69 | .arg("--bind") 70 | .arg("127.0.0.1"); 71 | redis::ConnectionAddr::Tcp("127.0.0.1".to_string(), server_port) 72 | } 73 | ServerType::Unix => { 74 | let (a, b) = rand::random::<(u64, u64)>(); 75 | let path = format!("/tmp/redis-rs-test-{}-{}.sock", a, b); 76 | cmd.arg("--port").arg("0").arg("--unixsocket").arg(&path); 77 | redis::ConnectionAddr::Unix(PathBuf::from(&path)) 78 | } 79 | }; 80 | 81 | let process = cmd.spawn().unwrap(); 82 | RedisServer { 83 | process: process, 84 | addr: addr, 85 | } 86 | } 87 | 88 | pub fn wait(&mut self) { 89 | self.process.wait().unwrap(); 90 | } 91 | 92 | pub fn get_client_addr(&self) -> &redis::ConnectionAddr { 93 | &self.addr 94 | } 95 | 96 | pub fn stop(&mut self) { 97 | let _ = self.process.kill(); 98 | let _ = self.process.wait(); 99 | match *self.get_client_addr() { 100 | redis::ConnectionAddr::Unix(ref path) => { 101 | fs::remove_file(&path).ok(); 102 | } 103 | _ => {} 104 | } 105 | } 106 | } 107 | 108 | impl Drop for RedisServer { 109 | fn drop(&mut self) { 110 | self.stop() 111 | } 112 | } 113 | 114 | pub struct TestContext { 115 | pub server: RedisServer, 116 | pub client: redis::Client, 117 | } 118 | 119 | impl TestContext { 120 | pub fn new() -> TestContext { 121 | let server = RedisServer::new(); 122 | 123 | let client = redis::Client::open(redis::ConnectionInfo { 124 | addr: Box::new(server.get_client_addr().clone()), 125 | db: 0, 126 | passwd: None, 127 | }) 128 | .unwrap(); 129 | let mut con; 130 | 131 | let millisecond = Duration::from_millis(1); 132 | loop { 133 | match client.get_connection() { 134 | Err(err) => { 135 | if err.is_connection_refusal() { 136 | sleep(millisecond); 137 | } else { 138 | panic!("Could not connect: {}", err); 139 | } 140 | } 141 | Ok(x) => { 142 | con = x; 143 | break; 144 | } 145 | } 146 | } 147 | redis::cmd("FLUSHDB").execute(&mut con); 148 | 149 | TestContext { 150 | server: server, 151 | client: client, 152 | } 153 | } 154 | 155 | pub fn connection(&self) -> redis::Connection { 156 | self.client.get_connection().unwrap() 157 | } 158 | 159 | pub fn stop_server(&mut self) { 160 | self.server.stop(); 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /src/types.rs: -------------------------------------------------------------------------------- 1 | use redis::{from_redis_value, FromRedisValue, RedisResult, RedisWrite, ToRedisArgs, Value}; 2 | 3 | use std::collections::HashMap; 4 | use std::io::{Error, ErrorKind}; 5 | 6 | // Stream Maxlen Enum 7 | 8 | /// Utility enum for passing `MAXLEN [= or ~] [COUNT]` 9 | /// arguments into `StreamCommands`. 10 | /// The enum value represents the count. 11 | #[derive(PartialEq, Eq, Clone, Debug, Copy)] 12 | pub enum StreamMaxlen { 13 | Equals(usize), 14 | Aprrox(usize), 15 | } 16 | 17 | impl ToRedisArgs for StreamMaxlen { 18 | fn write_redis_args(&self, out: &mut W) 19 | where 20 | W: ?Sized + RedisWrite, 21 | { 22 | let (ch, val) = match *self { 23 | StreamMaxlen::Equals(v) => ("=", v), 24 | StreamMaxlen::Aprrox(v) => ("~", v), 25 | }; 26 | out.write_arg("MAXLEN".as_bytes()); 27 | out.write_arg(ch.as_bytes()); 28 | val.write_redis_args(out); 29 | } 30 | } 31 | 32 | /// Builder options for [`xclaim_options`] command. 33 | /// 34 | /// [`xclaim_options`]: ./trait.StreamCommands.html#method.xclaim_options 35 | /// 36 | #[derive(Default, Debug)] 37 | pub struct StreamClaimOptions { 38 | /// Set IDLE cmd arg. 39 | idle: Option, 40 | /// Set TIME cmd arg. 41 | time: Option, 42 | /// Set RETRYCOUNT cmd arg. 43 | retry: Option, 44 | /// Set FORCE cmd arg. 45 | force: bool, 46 | /// Set JUSTID cmd arg. Be advised: the response 47 | /// type changes with this option. 48 | justid: bool, 49 | } 50 | 51 | impl StreamClaimOptions { 52 | pub fn idle(mut self, ms: usize) -> Self { 53 | self.idle = Some(ms); 54 | self 55 | } 56 | 57 | pub fn time(mut self, ms_time: usize) -> Self { 58 | self.time = Some(ms_time); 59 | self 60 | } 61 | 62 | pub fn retry(mut self, count: usize) -> Self { 63 | self.retry = Some(count); 64 | self 65 | } 66 | 67 | pub fn with_force(mut self) -> Self { 68 | self.force = true; 69 | self 70 | } 71 | 72 | pub fn with_justid(mut self) -> Self { 73 | self.justid = true; 74 | self 75 | } 76 | } 77 | 78 | impl ToRedisArgs for StreamClaimOptions { 79 | fn write_redis_args(&self, out: &mut W) 80 | where 81 | W: ?Sized + RedisWrite, 82 | { 83 | if let Some(ref ms) = self.idle { 84 | out.write_arg("IDLE".as_bytes()); 85 | out.write_arg(format!("{}", ms).as_bytes()); 86 | } 87 | if let Some(ref ms_time) = self.time { 88 | out.write_arg("TIME".as_bytes()); 89 | out.write_arg(format!("{}", ms_time).as_bytes()); 90 | } 91 | if let Some(ref count) = self.retry { 92 | out.write_arg("RETRYCOUNT".as_bytes()); 93 | out.write_arg(format!("{}", count).as_bytes()); 94 | } 95 | if self.force { 96 | out.write_arg("FORCE".as_bytes()); 97 | } 98 | if self.justid { 99 | out.write_arg("JUSTID".as_bytes()); 100 | } 101 | } 102 | } 103 | 104 | /// Builder options for [`xread_options`] command. 105 | /// 106 | /// [`xread_options`]: ./trait.StreamCommands.html#method.xread_options 107 | /// 108 | #[derive(Default, Debug)] 109 | pub struct StreamReadOptions { 110 | /// Set the BLOCK cmd arg. 111 | block: Option, 112 | /// Set the COUNT cmd arg. 113 | count: Option, 114 | /// Set the NOACK cmd arg. 115 | noack: Option, 116 | /// Set the GROUP cmd arg. 117 | /// This option will toggle the cmd from XREAD to XREADGROUP. 118 | group: Option<(Vec>, Vec>)>, 119 | } 120 | 121 | impl StreamReadOptions { 122 | pub fn read_only(&self) -> bool { 123 | self.group.is_none() 124 | } 125 | 126 | pub fn noack(mut self) -> Self { 127 | self.noack = Some(true); 128 | self 129 | } 130 | 131 | pub fn block(mut self, ms: usize) -> Self { 132 | self.block = Some(ms); 133 | self 134 | } 135 | 136 | pub fn count(mut self, n: usize) -> Self { 137 | self.count = Some(n); 138 | self 139 | } 140 | 141 | pub fn group( 142 | mut self, 143 | group_name: GN, 144 | consumer_name: CN, 145 | ) -> Self { 146 | self.group = Some(( 147 | ToRedisArgs::to_redis_args(&group_name), 148 | ToRedisArgs::to_redis_args(&consumer_name), 149 | )); 150 | self 151 | } 152 | } 153 | 154 | impl ToRedisArgs for StreamReadOptions { 155 | fn write_redis_args(&self, out: &mut W) 156 | where 157 | W: ?Sized + RedisWrite, 158 | { 159 | if let Some(ref ms) = self.block { 160 | out.write_arg("BLOCK".as_bytes()); 161 | out.write_arg(format!("{}", ms).as_bytes()); 162 | } 163 | 164 | if let Some(ref n) = self.count { 165 | out.write_arg("COUNT".as_bytes()); 166 | out.write_arg(format!("{}", n).as_bytes()); 167 | } 168 | 169 | if let Some(ref group) = self.group { 170 | // noack is only available w/ xreadgroup 171 | if let Some(true) = self.noack { 172 | out.write_arg("NOACK".as_bytes()); 173 | } 174 | 175 | out.write_arg("GROUP".as_bytes()); 176 | for i in &group.0 { 177 | out.write_arg(i); 178 | } 179 | for i in &group.1 { 180 | out.write_arg(i); 181 | } 182 | } 183 | } 184 | } 185 | 186 | /// Reply type used with [`xread`] or [`xread_options`] commands. 187 | /// 188 | /// [`xread`]: ./trait.StreamCommands.html#method.xread 189 | /// [`xread_options`]: ./trait.StreamCommands.html#method.xread_options 190 | /// 191 | #[derive(Default, Debug, Clone)] 192 | pub struct StreamReadReply { 193 | pub keys: Vec, 194 | } 195 | 196 | /// Reply type used with [`xrange`], [`xrange_count`], [`xrange_all`], [`xrevrange`], [`xrevrange_count`], [`xrevrange_all`] commands. 197 | /// 198 | /// [`xrange`]: ./trait.StreamCommands.html#method.xrange 199 | /// [`xrange_count`]: ./trait.StreamCommands.html#method.xrange_count 200 | /// [`xrange_all`]: ./trait.StreamCommands.html#method.xrange_all 201 | /// [`xrevrange`]: ./trait.StreamCommands.html#method.xrevrange 202 | /// [`xrevrange_count`]: ./trait.StreamCommands.html#method.xrevrange_count 203 | /// [`xrevrange_all`]: ./trait.StreamCommands.html#method.xrevrange_all 204 | /// 205 | #[derive(Default, Debug, Clone)] 206 | pub struct StreamRangeReply { 207 | pub ids: Vec, 208 | } 209 | 210 | /// Reply type used with [`xclaim`] command. 211 | /// 212 | /// [`xclaim`]: ./trait.StreamCommands.html#method.xclaim 213 | /// 214 | #[derive(Default, Debug, Clone)] 215 | pub struct StreamClaimReply { 216 | pub ids: Vec, 217 | } 218 | 219 | /// Reply type used with [`xpending`] command. 220 | /// 221 | /// [`xpending`]: ./trait.StreamCommands.html#method.xpending 222 | /// 223 | #[derive(Debug, Clone)] 224 | pub enum StreamPendingReply { 225 | Empty, 226 | Data(StreamPendingData), 227 | } 228 | 229 | impl Default for StreamPendingReply { 230 | fn default() -> StreamPendingReply { 231 | StreamPendingReply::Empty 232 | } 233 | } 234 | 235 | impl StreamPendingReply { 236 | pub fn count(&self) -> usize { 237 | match self { 238 | StreamPendingReply::Empty => 0, 239 | StreamPendingReply::Data(x) => x.count, 240 | } 241 | } 242 | } 243 | 244 | /// Inner reply type when an [`xpending`] command has data. 245 | #[derive(Default, Debug, Clone)] 246 | pub struct StreamPendingData { 247 | pub count: usize, 248 | pub start_id: String, 249 | pub end_id: String, 250 | pub consumers: Vec, 251 | } 252 | 253 | /// Reply type used with [`xpending_count`] and 254 | /// [`xpending_consumer_count`] commands. 255 | /// 256 | /// [`xpending_count`]: ./trait.StreamCommands.html#method.xpending_count 257 | /// [`xpending_consumer_count`]: ./trait.StreamCommands.html#method.xpending_consumer_count 258 | /// 259 | #[derive(Default, Debug, Clone)] 260 | pub struct StreamPendingCountReply { 261 | pub ids: Vec, 262 | } 263 | 264 | /// Reply type used with [`xinfo_stream`] command. 265 | /// 266 | /// [`xinfo_stream`]: ./trait.StreamCommands.html#method.xinfo_stream 267 | /// 268 | #[derive(Default, Debug, Clone)] 269 | pub struct StreamInfoStreamReply { 270 | pub last_generated_id: String, 271 | pub radix_tree_keys: usize, 272 | pub groups: usize, 273 | pub length: usize, 274 | pub first_entry: StreamId, 275 | pub last_entry: StreamId, 276 | } 277 | 278 | /// Reply type used with [`xinfo_consumer`] command. 279 | /// 280 | /// [`xinfo_consumer`]: ./trait.StreamCommands.html#method.xinfo_consumer 281 | /// 282 | #[derive(Default, Debug, Clone)] 283 | pub struct StreamInfoConsumersReply { 284 | pub consumers: Vec, 285 | } 286 | 287 | /// Reply type used with [`xinfo_groups`] command. 288 | /// 289 | /// [`xinfo_groups`]: ./trait.StreamCommands.html#method.xinfo_groups 290 | /// 291 | #[derive(Default, Debug, Clone)] 292 | pub struct StreamInfoGroupsReply { 293 | pub groups: Vec, 294 | } 295 | 296 | /// A consumer parsed from [`xinfo_consumers`] command. 297 | /// 298 | /// [`xinfo_consumers`]: ./trait.StreamCommands.html#method.xinfo_consumers 299 | /// 300 | #[derive(Default, Debug, Clone)] 301 | pub struct StreamInfoConsumer { 302 | pub name: String, 303 | pub pending: usize, 304 | pub idle: usize, 305 | } 306 | 307 | /// A group parsed from [`xinfo_groups`] command. 308 | /// 309 | /// [`xinfo_groups`]: ./trait.StreamCommands.html#method.xinfo_groups 310 | /// 311 | #[derive(Default, Debug, Clone)] 312 | pub struct StreamInfoGroup { 313 | pub name: String, 314 | pub consumers: usize, 315 | pub pending: usize, 316 | pub last_delivered_id: String, 317 | } 318 | 319 | /// Represents a pending message parsed from `xpending` methods. 320 | #[derive(Default, Debug, Clone)] 321 | pub struct StreamPendingId { 322 | pub id: String, 323 | pub consumer: String, 324 | pub last_delivered_ms: usize, 325 | pub times_delivered: usize, 326 | } 327 | 328 | /// Represents a stream `key` and its `id`'s parsed from `xread` methods. 329 | #[derive(Default, Debug, Clone)] 330 | pub struct StreamKey { 331 | pub key: String, 332 | pub ids: Vec, 333 | } 334 | 335 | impl StreamKey { 336 | pub fn just_ids(&self) -> Vec<&String> { 337 | self.ids.iter().map(|msg| &msg.id).collect::>() 338 | } 339 | } 340 | 341 | /// Represents a stream `id` and its field/values as a `HashMap` 342 | #[derive(Default, Debug, Clone)] 343 | pub struct StreamId { 344 | pub id: String, 345 | pub map: HashMap, 346 | } 347 | 348 | impl StreamId { 349 | pub fn from_bulk_value(v: &Value) -> RedisResult { 350 | let mut stream_id = StreamId::default(); 351 | match *v { 352 | Value::Bulk(ref values) => { 353 | if let Some(v) = values.get(0) { 354 | stream_id.id = from_redis_value(&v)?; 355 | } 356 | if let Some(v) = values.get(1) { 357 | stream_id.map = from_redis_value(&v)?; 358 | } 359 | } 360 | _ => {} 361 | } 362 | 363 | Ok(stream_id) 364 | } 365 | 366 | pub fn get(&self, key: &str) -> Option { 367 | match self.find(&key) { 368 | Some(ref x) => from_redis_value(*x).ok(), 369 | None => None, 370 | } 371 | } 372 | 373 | pub fn find(&self, key: &&str) -> Option<&Value> { 374 | self.map.get(*key) 375 | } 376 | 377 | pub fn contains_key(&self, key: &&str) -> bool { 378 | self.find(key).is_some() 379 | } 380 | 381 | pub fn len(&self) -> usize { 382 | self.map.len() 383 | } 384 | } 385 | 386 | impl FromRedisValue for StreamReadReply { 387 | fn from_redis_value(v: &Value) -> RedisResult { 388 | let rows: Vec>>>> = 389 | from_redis_value(v)?; 390 | let mut reply = StreamReadReply::default(); 391 | for row in &rows { 392 | for (key, entry) in row.iter() { 393 | let mut k = StreamKey::default(); 394 | k.key = key.to_owned(); 395 | for id_row in entry { 396 | let mut i = StreamId::default(); 397 | for (id, map) in id_row.iter() { 398 | i.id = id.to_owned(); 399 | i.map = map.to_owned(); 400 | } 401 | k.ids.push(i); 402 | } 403 | reply.keys.push(k); 404 | } 405 | } 406 | Ok(reply) 407 | } 408 | } 409 | 410 | impl FromRedisValue for StreamRangeReply { 411 | fn from_redis_value(v: &Value) -> RedisResult { 412 | let rows: Vec>> = from_redis_value(v)?; 413 | let mut reply = StreamRangeReply::default(); 414 | for row in &rows { 415 | let mut i = StreamId::default(); 416 | for (id, map) in row.iter() { 417 | i.id = id.to_owned(); 418 | i.map = map.to_owned(); 419 | } 420 | reply.ids.push(i); 421 | } 422 | Ok(reply) 423 | } 424 | } 425 | 426 | impl FromRedisValue for StreamClaimReply { 427 | fn from_redis_value(v: &Value) -> RedisResult { 428 | let rows: Vec>> = from_redis_value(v)?; 429 | let mut reply = StreamClaimReply::default(); 430 | for row in &rows { 431 | let mut i = StreamId::default(); 432 | for (id, map) in row.iter() { 433 | i.id = id.to_owned(); 434 | i.map = map.to_owned(); 435 | } 436 | reply.ids.push(i); 437 | } 438 | Ok(reply) 439 | } 440 | } 441 | 442 | impl FromRedisValue for StreamPendingReply { 443 | fn from_redis_value(v: &Value) -> RedisResult { 444 | let parts: (usize, Option, Option, Vec>) = from_redis_value(v)?; 445 | let count = parts.0.to_owned() as usize; 446 | 447 | if count == 0 { 448 | Ok(StreamPendingReply::Empty) 449 | } else { 450 | let mut result = StreamPendingData::default(); 451 | 452 | let start_id = match parts.1.to_owned() { 453 | Some(start) => Ok(start), 454 | None => Err(Error::new( 455 | ErrorKind::Other, 456 | "IllegalState: Non-zero pending expects start id", 457 | )), 458 | }?; 459 | 460 | let end_id = match parts.2.to_owned() { 461 | Some(end) => Ok(end), 462 | None => Err(Error::new( 463 | ErrorKind::Other, 464 | "IllegalState: Non-zero pending expects end id", 465 | )), 466 | }?; 467 | 468 | result.count = count; 469 | result.start_id = start_id; 470 | result.end_id = end_id; 471 | 472 | for consumer in &parts.3 { 473 | let mut info = StreamInfoConsumer::default(); 474 | info.name = consumer[0].to_owned(); 475 | if let Ok(v) = consumer[1].to_owned().parse::() { 476 | info.pending = v; 477 | } 478 | result.consumers.push(info); 479 | } 480 | 481 | Ok(StreamPendingReply::Data(result)) 482 | } 483 | } 484 | } 485 | 486 | impl FromRedisValue for StreamPendingCountReply { 487 | fn from_redis_value(v: &Value) -> RedisResult { 488 | let parts: Vec> = from_redis_value(v)?; 489 | let mut reply = StreamPendingCountReply::default(); 490 | for row in &parts { 491 | let mut p = StreamPendingId::default(); 492 | p.id = row[0].0.to_owned(); 493 | p.consumer = row[0].1.to_owned(); 494 | p.last_delivered_ms = row[0].2.to_owned(); 495 | p.times_delivered = row[0].3.to_owned(); 496 | reply.ids.push(p); 497 | } 498 | Ok(reply) 499 | } 500 | } 501 | 502 | impl FromRedisValue for StreamInfoStreamReply { 503 | fn from_redis_value(v: &Value) -> RedisResult { 504 | let map: HashMap = from_redis_value(v)?; 505 | let mut reply = StreamInfoStreamReply::default(); 506 | if let Some(v) = &map.get("last-generated-id") { 507 | reply.last_generated_id = from_redis_value(v)?; 508 | } 509 | if let Some(v) = &map.get("radix-tree-nodes") { 510 | reply.radix_tree_keys = from_redis_value(v)?; 511 | } 512 | if let Some(v) = &map.get("groups") { 513 | reply.groups = from_redis_value(v)?; 514 | } 515 | if let Some(v) = &map.get("length") { 516 | reply.length = from_redis_value(v)?; 517 | } 518 | if let Some(v) = &map.get("first-entry") { 519 | reply.first_entry = StreamId::from_bulk_value(v)?; 520 | } 521 | if let Some(v) = &map.get("last-entry") { 522 | reply.last_entry = StreamId::from_bulk_value(v)?; 523 | } 524 | Ok(reply) 525 | } 526 | } 527 | 528 | impl FromRedisValue for StreamInfoConsumersReply { 529 | fn from_redis_value(v: &Value) -> RedisResult { 530 | let consumers: Vec> = from_redis_value(v)?; 531 | let mut reply = StreamInfoConsumersReply::default(); 532 | for map in consumers { 533 | let mut c = StreamInfoConsumer::default(); 534 | if let Some(v) = &map.get("name") { 535 | c.name = from_redis_value(v)?; 536 | } 537 | if let Some(v) = &map.get("pending") { 538 | c.pending = from_redis_value(v)?; 539 | } 540 | if let Some(v) = &map.get("idle") { 541 | c.idle = from_redis_value(v)?; 542 | } 543 | reply.consumers.push(c); 544 | } 545 | 546 | Ok(reply) 547 | } 548 | } 549 | 550 | impl FromRedisValue for StreamInfoGroupsReply { 551 | fn from_redis_value(v: &Value) -> RedisResult { 552 | let groups: Vec> = from_redis_value(v)?; 553 | let mut reply = StreamInfoGroupsReply::default(); 554 | for map in groups { 555 | let mut g = StreamInfoGroup::default(); 556 | if let Some(v) = &map.get("name") { 557 | g.name = from_redis_value(v)?; 558 | } 559 | if let Some(v) = &map.get("pending") { 560 | g.pending = from_redis_value(v)?; 561 | } 562 | if let Some(v) = &map.get("consumers") { 563 | g.consumers = from_redis_value(v)?; 564 | } 565 | if let Some(v) = &map.get("last-delivered-id") { 566 | g.last_delivered_id = from_redis_value(v)?; 567 | } 568 | reply.groups.push(g); 569 | } 570 | Ok(reply) 571 | } 572 | } 573 | -------------------------------------------------------------------------------- /tests/test_streams.rs: -------------------------------------------------------------------------------- 1 | extern crate redis; 2 | extern crate redis_streams; 3 | 4 | use redis::{Connection, RedisResult, ToRedisArgs}; 5 | 6 | use redis_streams::{ 7 | StreamClaimOptions, StreamClaimReply, StreamCommands, StreamInfoConsumersReply, 8 | StreamInfoGroupsReply, StreamInfoStreamReply, StreamMaxlen, StreamPendingCountReply, 9 | StreamPendingReply, StreamRangeReply, StreamReadOptions, StreamReadReply, 10 | }; 11 | 12 | use std::collections::BTreeMap; 13 | use std::str; 14 | use std::thread::sleep; 15 | use std::time::Duration; 16 | 17 | use crate::support::*; 18 | 19 | mod support; 20 | 21 | macro_rules! assert_args { 22 | ($value:expr, $($args:expr),+) => { 23 | let args = $value.to_redis_args(); 24 | let strings: Vec<_> = args.iter() 25 | .map(|a| str::from_utf8(a.as_ref()).unwrap()) 26 | .collect(); 27 | assert_eq!(strings, vec![$($args),+]); 28 | } 29 | } 30 | 31 | fn xadd(con: &mut Connection) { 32 | let _: RedisResult = 33 | con.xadd("k1", "1000-0", &[("hello", "world"), ("redis", "streams")]); 34 | let _: RedisResult = con.xadd("k1", "1000-1", &[("hello", "world2")]); 35 | let _: RedisResult = con.xadd("k2", "2000-0", &[("hello", "world")]); 36 | let _: RedisResult = con.xadd("k2", "2000-1", &[("hello", "world2")]); 37 | } 38 | 39 | fn xadd_keyrange(con: &mut Connection, key: &str, start: i32, end: i32) { 40 | for _i in start..end { 41 | let _: RedisResult = con.xadd(key, "*", &[("h", "w")]); 42 | } 43 | } 44 | 45 | #[test] 46 | fn test_cmd_options() { 47 | // Tests the following command option builders.... 48 | // xclaim_options 49 | // xread_options 50 | // maxlen enum 51 | 52 | // test read options 53 | 54 | let empty = StreamClaimOptions::default(); 55 | assert_eq!(ToRedisArgs::to_redis_args(&empty).len(), 0); 56 | 57 | let empty = StreamReadOptions::default(); 58 | assert_eq!(ToRedisArgs::to_redis_args(&empty).len(), 0); 59 | 60 | let opts = StreamClaimOptions::default() 61 | .idle(50) 62 | .time(500) 63 | .retry(3) 64 | .with_force() 65 | .with_justid(); 66 | 67 | assert_args!( 68 | &opts, 69 | "IDLE", 70 | "50", 71 | "TIME", 72 | "500", 73 | "RETRYCOUNT", 74 | "3", 75 | "FORCE", 76 | "JUSTID" 77 | ); 78 | 79 | // test maxlen options 80 | 81 | assert_args!(StreamMaxlen::Aprrox(10), "MAXLEN", "~", "10"); 82 | assert_args!(StreamMaxlen::Equals(10), "MAXLEN", "=", "10"); 83 | 84 | // test read options 85 | 86 | let opts = StreamReadOptions::default() 87 | .noack() 88 | .block(100) 89 | .count(200) 90 | .group("group-name", "consumer-name"); 91 | 92 | assert_args!( 93 | &opts, 94 | "BLOCK", 95 | "100", 96 | "COUNT", 97 | "200", 98 | "NOACK", 99 | "GROUP", 100 | "group-name", 101 | "consumer-name" 102 | ); 103 | 104 | // should skip noack because of missing group(,) 105 | let opts = StreamReadOptions::default().noack().block(100).count(200); 106 | 107 | assert_args!(&opts, "BLOCK", "100", "COUNT", "200"); 108 | } 109 | 110 | #[test] 111 | fn test_assorted_1() { 112 | // Tests the following commands.... 113 | // xadd 114 | // xadd_map (skip this for now) 115 | // xadd_maxlen 116 | // xread 117 | // xlen 118 | 119 | let ctx = TestContext::new(); 120 | let mut con = ctx.connection(); 121 | 122 | xadd(&mut con); 123 | 124 | // smoke test that we get the same id back 125 | let result: RedisResult = con.xadd("k0", "1000-0", &[("x", "y")]); 126 | assert_eq!(result.unwrap(), "1000-0"); 127 | 128 | // xread reply 129 | let reply: StreamReadReply = con.xread(&["k1", "k2", "k3"], &["0", "0", "0"]).unwrap(); 130 | 131 | // verify reply contains 2 keys even though we asked for 3 132 | assert_eq!(&reply.keys.len(), &2usize); 133 | 134 | // verify first key & first id exist 135 | assert_eq!(&reply.keys[0].key, "k1"); 136 | assert_eq!(&reply.keys[0].ids.len(), &2usize); 137 | assert_eq!(&reply.keys[0].ids[0].id, "1000-0"); 138 | 139 | // lookup the key in StreamId map 140 | let hello: Option = reply.keys[0].ids[0].get("hello"); 141 | assert_eq!(hello, Some("world".to_string())); 142 | 143 | // verify the second key was written 144 | assert_eq!(&reply.keys[1].key, "k2"); 145 | assert_eq!(&reply.keys[1].ids.len(), &2usize); 146 | assert_eq!(&reply.keys[1].ids[0].id, "2000-0"); 147 | 148 | // test xadd_map 149 | let mut map: BTreeMap<&str, &str> = BTreeMap::new(); 150 | map.insert("ab", "cd"); 151 | map.insert("ef", "gh"); 152 | map.insert("ij", "kl"); 153 | let _: RedisResult = con.xadd_map("k3", "3000-0", map); 154 | 155 | let reply: StreamRangeReply = con.xrange_all("k3").unwrap(); 156 | assert_eq!(reply.ids[0].contains_key(&"ab"), true); 157 | assert_eq!(reply.ids[0].contains_key(&"ef"), true); 158 | assert_eq!(reply.ids[0].contains_key(&"ij"), true); 159 | 160 | // test xadd w/ maxlength below... 161 | 162 | // add 100 things to k4 163 | xadd_keyrange(&mut con, "k4", 0, 100); 164 | 165 | // test xlen.. should have 100 items 166 | let result: RedisResult = con.xlen("k4"); 167 | assert_eq!(result, Ok(100)); 168 | 169 | // test xadd_maxlen 170 | let _: RedisResult = 171 | con.xadd_maxlen("k4", StreamMaxlen::Equals(10), "*", &[("h", "w")]); 172 | let result: RedisResult = con.xlen("k4"); 173 | assert_eq!(result, Ok(10)); 174 | } 175 | 176 | #[test] 177 | fn test_assorted_2() { 178 | // Tests the following commands.... 179 | // xadd 180 | // xinfo_stream 181 | // xinfo_groups 182 | // xinfo_consumer 183 | // xgroup_create 184 | // xgroup_create_mkstream 185 | // xread_options 186 | // xack 187 | // xpending 188 | // xpending_count 189 | // xpending_consumer_count 190 | 191 | let ctx = TestContext::new(); 192 | let mut con = ctx.connection(); 193 | 194 | xadd(&mut con); 195 | 196 | // no key exists... this call breaks the connection pipe for some reason 197 | let reply: RedisResult = con.xinfo_stream("k10"); 198 | assert_eq!(reply.is_err(), true); 199 | 200 | // redo the connection because the above error 201 | con = ctx.connection(); 202 | 203 | // key should exist 204 | let reply: StreamInfoStreamReply = con.xinfo_stream("k1").unwrap(); 205 | assert_eq!(&reply.first_entry.id, "1000-0"); 206 | assert_eq!(&reply.last_entry.id, "1000-1"); 207 | assert_eq!(&reply.last_generated_id, "1000-1"); 208 | 209 | // xgroup create (existing stream) 210 | let result: RedisResult = con.xgroup_create("k1", "g1", "$"); 211 | assert_eq!(result.is_ok(), true); 212 | 213 | // xinfo groups (existing stream) 214 | let result: RedisResult = con.xinfo_groups("k1"); 215 | assert_eq!(result.is_ok(), true); 216 | let reply = result.unwrap(); 217 | assert_eq!(&reply.groups.len(), &1); 218 | assert_eq!(&reply.groups[0].name, &"g1"); 219 | 220 | // test xgroup create w/ mkstream @ 0 221 | let result: RedisResult = con.xgroup_create_mkstream("k99", "g99", "0"); 222 | assert_eq!(result.is_ok(), true); 223 | 224 | // Since nothing exists on this stream yet, 225 | // it should have the defaults returned by the client 226 | let result: RedisResult = con.xinfo_groups("k99"); 227 | assert_eq!(result.is_ok(), true); 228 | let reply = result.unwrap(); 229 | assert_eq!(&reply.groups.len(), &1); 230 | assert_eq!(&reply.groups[0].name, &"g99"); 231 | assert_eq!(&reply.groups[0].last_delivered_id, &"0-0"); 232 | 233 | // call xadd on k99 just so we can read from it 234 | // using consumer g99 and test xinfo_consumers 235 | let _: RedisResult = con.xadd("k99", "1000-0", &[("a", "b"), ("c", "d")]); 236 | let _: RedisResult = con.xadd("k99", "1000-1", &[("e", "f"), ("g", "h")]); 237 | 238 | // test empty PEL 239 | let empty_reply: StreamPendingReply = con.xpending("k99", "g99").unwrap(); 240 | 241 | assert_eq!(empty_reply.count(), 0); 242 | if let StreamPendingReply::Empty = empty_reply { 243 | // looks good 244 | } else { 245 | panic!("Expected StreamPendingReply::Empty but got Data"); 246 | } 247 | 248 | // passing options w/ group triggers XREADGROUP 249 | // using ID=">" means all undelivered ids 250 | // otherwise, ID="0 | ms-num" means all pending already 251 | // sent to this client 252 | let reply: StreamReadReply = con 253 | .xread_options( 254 | &["k99"], 255 | &[">"], 256 | StreamReadOptions::default().group("g99", "c99"), 257 | ) 258 | .unwrap(); 259 | assert_eq!(reply.keys[0].ids.len(), 2); 260 | 261 | // read xinfo consumers again, should have 2 messages for the c99 consumer 262 | let reply: StreamInfoConsumersReply = con.xinfo_consumers("k99", "g99").unwrap(); 263 | assert_eq!(reply.consumers[0].pending, 2); 264 | 265 | // ack one of these messages 266 | let result: RedisResult = con.xack("k99", "g99", &["1000-0"]); 267 | assert_eq!(result, Ok(1)); 268 | 269 | // get pending messages already seen by this client 270 | // we should only have one now.. 271 | let reply: StreamReadReply = con 272 | .xread_options( 273 | &["k99"], 274 | &["0"], 275 | StreamReadOptions::default().group("g99", "c99"), 276 | ) 277 | .unwrap(); 278 | assert_eq!(reply.keys.len(), 1); 279 | 280 | // we should also have one pending here... 281 | let reply: StreamInfoConsumersReply = con.xinfo_consumers("k99", "g99").unwrap(); 282 | assert_eq!(reply.consumers[0].pending, 1); 283 | 284 | // add more and read so we can test xpending 285 | let _: RedisResult = con.xadd("k99", "1001-0", &[("i", "j"), ("k", "l")]); 286 | let _: RedisResult = con.xadd("k99", "1001-1", &[("m", "n"), ("o", "p")]); 287 | let _: StreamReadReply = con 288 | .xread_options( 289 | &["k99"], 290 | &[">"], 291 | StreamReadOptions::default().group("g99", "c99"), 292 | ) 293 | .unwrap(); 294 | 295 | // call xpending here... 296 | // this has a different reply from what the count variations return 297 | let data_reply: StreamPendingReply = con.xpending("k99", "g99").unwrap(); 298 | 299 | assert_eq!(data_reply.count(), 3); 300 | 301 | if let StreamPendingReply::Data(data) = data_reply { 302 | assert_eq!(data.start_id, "1000-1"); 303 | assert_eq!(data.end_id, "1001-1"); 304 | assert_eq!(data.consumers.len(), 1); 305 | assert_eq!(data.consumers[0].name, "c99"); 306 | } else { 307 | panic!("Expected StreamPendingReply::Data but got Empty"); 308 | } 309 | 310 | // both count variations have the same reply types 311 | let reply: StreamPendingCountReply = con.xpending_count("k99", "g99", "-", "+", 10).unwrap(); 312 | assert_eq!(reply.ids.len(), 3); 313 | 314 | let reply: StreamPendingCountReply = con 315 | .xpending_consumer_count("k99", "g99", "-", "+", 10, "c99") 316 | .unwrap(); 317 | assert_eq!(reply.ids.len(), 3); 318 | } 319 | 320 | #[test] 321 | fn test_xadd_maxlen_map() { 322 | let ctx = TestContext::new(); 323 | let mut con = ctx.connection(); 324 | 325 | for i in 0..10 { 326 | let mut map: BTreeMap<&str, &str> = BTreeMap::new(); 327 | let idx = i.to_string(); 328 | map.insert("idx", &idx); 329 | let _: RedisResult = 330 | con.xadd_maxlen_map("maxlen_map", StreamMaxlen::Equals(3), "*", map); 331 | } 332 | 333 | let result: RedisResult = con.xlen("maxlen_map"); 334 | assert_eq!(result, Ok(3)); 335 | let reply: StreamRangeReply = con.xrange_all("maxlen_map").unwrap(); 336 | 337 | assert_eq!(reply.ids[0].get("idx"), Some("7".to_string())); 338 | assert_eq!(reply.ids[1].get("idx"), Some("8".to_string())); 339 | assert_eq!(reply.ids[2].get("idx"), Some("9".to_string())); 340 | } 341 | 342 | #[test] 343 | fn test_xclaim() { 344 | // Tests the following commands.... 345 | // xclaim 346 | // xclaim_options 347 | let ctx = TestContext::new(); 348 | let mut con = ctx.connection(); 349 | 350 | // xclaim test basic idea: 351 | // 1. we need to test adding messages to a group 352 | // 2. then xreadgroup needs to define a consumer and read pending 353 | // messages without acking them 354 | // 3. then we need to sleep 5ms and call xpending 355 | // 4. from here we should be able to claim message 356 | // past the idle time and read them from a different consumer 357 | 358 | // create the group 359 | let result: RedisResult = con.xgroup_create_mkstream("k1", "g1", "$"); 360 | assert_eq!(result.is_ok(), true); 361 | 362 | // add some keys 363 | xadd_keyrange(&mut con, "k1", 0, 10); 364 | 365 | // read the pending items for this key & group 366 | let reply: StreamReadReply = con 367 | .xread_options( 368 | &["k1"], 369 | &[">"], 370 | StreamReadOptions::default().group("g1", "c1"), 371 | ) 372 | .unwrap(); 373 | // verify we have 10 ids 374 | assert_eq!(reply.keys[0].ids.len(), 10); 375 | 376 | // save this StreamId for later 377 | let claim = &reply.keys[0].ids[0]; 378 | let _claim_1 = &reply.keys[0].ids[1]; 379 | let claim_justids = &reply.keys[0].just_ids(); 380 | 381 | // sleep for 5ms 382 | sleep(Duration::from_millis(5)); 383 | 384 | // grab this id if > 4ms 385 | let reply: StreamClaimReply = con 386 | .xclaim("k1", "g1", "c2", 4, &[claim.id.clone()]) 387 | .unwrap(); 388 | assert_eq!(reply.ids.len(), 1); 389 | assert_eq!(reply.ids[0].id, claim.id); 390 | 391 | // grab all pending ids for this key... 392 | // we should 9 in c1 and 1 in c2 393 | let reply: StreamPendingReply = con.xpending("k1", "g1").unwrap(); 394 | if let StreamPendingReply::Data(data) = reply { 395 | assert_eq!(data.consumers[0].name, "c1"); 396 | assert_eq!(data.consumers[0].pending, 9); 397 | assert_eq!(data.consumers[1].name, "c2"); 398 | assert_eq!(data.consumers[1].pending, 1); 399 | } 400 | 401 | // sleep for 5ms 402 | sleep(Duration::from_millis(5)); 403 | 404 | // lets test some of the xclaim_options 405 | // call force on the same claim.id 406 | let _: StreamClaimReply = con 407 | .xclaim_options( 408 | "k1", 409 | "g1", 410 | "c3", 411 | 4, 412 | &[claim.id.clone()], 413 | StreamClaimOptions::default().with_force(), 414 | ) 415 | .unwrap(); 416 | 417 | let reply: StreamPendingReply = con.xpending("k1", "g1").unwrap(); 418 | // we should have 9 w/ c1 and 1 w/ c3 now 419 | if let StreamPendingReply::Data(data) = reply { 420 | assert_eq!(data.consumers[1].name, "c3"); 421 | assert_eq!(data.consumers[1].pending, 1); 422 | } 423 | 424 | // sleep for 5ms 425 | sleep(Duration::from_millis(5)); 426 | 427 | // claim and only return JUSTID 428 | let claimed: Vec = con 429 | .xclaim_options( 430 | "k1", 431 | "g1", 432 | "c5", 433 | 4, 434 | &claim_justids, 435 | StreamClaimOptions::default().with_force().with_justid(), 436 | ) 437 | .unwrap(); 438 | // we just claimed the original 10 ids 439 | // and only returned the ids 440 | assert_eq!(claimed.len(), 10); 441 | } 442 | 443 | #[test] 444 | fn test_xdel() { 445 | // Tests the following commands.... 446 | // xdel 447 | let ctx = TestContext::new(); 448 | let mut con = ctx.connection(); 449 | 450 | // add some keys 451 | xadd(&mut con); 452 | 453 | // delete the first stream item for this key 454 | let result: RedisResult = con.xdel("k1", &["1000-0"]); 455 | // returns the number of items deleted 456 | assert_eq!(result, Ok(1)); 457 | 458 | let result: RedisResult = con.xdel("k2", &["2000-0", "2000-1", "2000-2"]); 459 | // should equal 2 since the last id doesn't exist 460 | assert_eq!(result, Ok(2)); 461 | } 462 | 463 | #[test] 464 | fn test_xtrim() { 465 | // Tests the following commands.... 466 | // xtrim 467 | let ctx = TestContext::new(); 468 | let mut con = ctx.connection(); 469 | 470 | // add some keys 471 | xadd_keyrange(&mut con, "k1", 0, 100); 472 | 473 | // trim key to 50 474 | // returns the number of items remaining in the stream 475 | let result: RedisResult = con.xtrim("k1", StreamMaxlen::Equals(50)); 476 | assert_eq!(result, Ok(50)); 477 | // we should end up with 40 after this call 478 | let result: RedisResult = con.xtrim("k1", StreamMaxlen::Equals(10)); 479 | assert_eq!(result, Ok(40)); 480 | } 481 | 482 | #[test] 483 | fn test_xgroup() { 484 | // Tests the following commands.... 485 | // xgroup_create_mkstream 486 | // xgroup_destroy 487 | // xgroup_delconsumer 488 | 489 | let ctx = TestContext::new(); 490 | let mut con = ctx.connection(); 491 | 492 | // test xgroup create w/ mkstream @ 0 493 | let result: RedisResult = con.xgroup_create_mkstream("k1", "g1", "0"); 494 | assert_eq!(result.is_ok(), true); 495 | 496 | // destroy this new stream group 497 | let result: RedisResult = con.xgroup_destroy("k1", "g1"); 498 | assert_eq!(result, Ok(1)); 499 | 500 | // add some keys 501 | xadd(&mut con); 502 | 503 | // create the group again using an existing stream 504 | let result: RedisResult = con.xgroup_create("k1", "g1", "0"); 505 | assert_eq!(result.is_ok(), true); 506 | 507 | // read from the group so we can register the consumer 508 | let reply: StreamReadReply = con 509 | .xread_options( 510 | &["k1"], 511 | &[">"], 512 | StreamReadOptions::default().group("g1", "c1"), 513 | ) 514 | .unwrap(); 515 | assert_eq!(reply.keys[0].ids.len(), 2); 516 | 517 | let result: RedisResult = con.xgroup_delconsumer("k1", "g1", "c1"); 518 | // returns the number of pending message this client had open 519 | assert_eq!(result, Ok(2)); 520 | 521 | let result: RedisResult = con.xgroup_destroy("k1", "g1"); 522 | assert_eq!(result, Ok(1)); 523 | } 524 | 525 | #[test] 526 | fn test_xrange() { 527 | // Tests the following commands.... 528 | // xrange (-/+ variations) 529 | // xrange_all 530 | // xrange_count 531 | 532 | let ctx = TestContext::new(); 533 | let mut con = ctx.connection(); 534 | 535 | xadd(&mut con); 536 | 537 | // xrange replies 538 | let reply: StreamRangeReply = con.xrange_all("k1").unwrap(); 539 | assert_eq!(reply.ids.len(), 2); 540 | 541 | let reply: StreamRangeReply = con.xrange("k1", "1000-1", "+").unwrap(); 542 | assert_eq!(reply.ids.len(), 1); 543 | 544 | let reply: StreamRangeReply = con.xrange("k1", "-", "1000-0").unwrap(); 545 | assert_eq!(reply.ids.len(), 1); 546 | 547 | let reply: StreamRangeReply = con.xrange_count("k1", "-", "+", 1).unwrap(); 548 | assert_eq!(reply.ids.len(), 1); 549 | } 550 | 551 | #[test] 552 | fn test_xrevrange() { 553 | // Tests the following commands.... 554 | // xrevrange (+/- variations) 555 | // xrevrange_all 556 | // xrevrange_count 557 | 558 | let ctx = TestContext::new(); 559 | let mut con = ctx.connection(); 560 | 561 | xadd(&mut con); 562 | 563 | // xrange replies 564 | let reply: StreamRangeReply = con.xrevrange_all("k1").unwrap(); 565 | assert_eq!(reply.ids.len(), 2); 566 | 567 | let reply: StreamRangeReply = con.xrevrange("k1", "1000-1", "-").unwrap(); 568 | assert_eq!(reply.ids.len(), 2); 569 | 570 | let reply: StreamRangeReply = con.xrevrange("k1", "+", "1000-1").unwrap(); 571 | assert_eq!(reply.ids.len(), 1); 572 | 573 | let reply: StreamRangeReply = con.xrevrange_count("k1", "+", "-", 1).unwrap(); 574 | assert_eq!(reply.ids.len(), 1); 575 | } 576 | -------------------------------------------------------------------------------- /src/commands.rs: -------------------------------------------------------------------------------- 1 | use crate::types::{ 2 | StreamClaimOptions, StreamClaimReply, StreamInfoConsumersReply, StreamInfoGroupsReply, 3 | StreamInfoStreamReply, StreamMaxlen, StreamPendingCountReply, StreamPendingReply, 4 | StreamRangeReply, StreamReadOptions, StreamReadReply, 5 | }; 6 | 7 | use redis::{cmd, ConnectionLike, FromRedisValue, RedisResult, ToRedisArgs}; 8 | 9 | /// Implementation of all redis stream commands. 10 | /// 11 | pub trait StreamCommands: ConnectionLike + Sized { 12 | // XACK ... 13 | 14 | /// Ack pending stream messages checked out by a consumer. 15 | /// 16 | #[inline] 17 | fn xack( 18 | &mut self, 19 | key: K, 20 | group: G, 21 | ids: &[ID], 22 | ) -> RedisResult { 23 | cmd("XACK").arg(key).arg(group).arg(ids).query(self) 24 | } 25 | 26 | // XADD key [field value] [field value] ... 27 | 28 | /// Add a stream message by `key`. Use `*` as the `id` for the current timestamp. 29 | /// 30 | #[inline] 31 | fn xadd( 32 | &mut self, 33 | key: K, 34 | id: ID, 35 | items: &[(F, V)], 36 | ) -> RedisResult { 37 | cmd("XADD").arg(key).arg(id).arg(items).query(self) 38 | } 39 | 40 | // XADD key [rust BTreeMap] ... 41 | 42 | /// BTreeMap variant for adding a stream message by `key`. 43 | /// Use `*` as the `id` for the current timestamp. 44 | /// 45 | #[inline] 46 | fn xadd_map( 47 | &mut self, 48 | key: K, 49 | id: ID, 50 | map: BTM, 51 | ) -> RedisResult { 52 | cmd("XADD").arg(key).arg(id).arg(map).query(self) 53 | } 54 | 55 | // XADD key [MAXLEN [~|=] ] [field value] [field value] ... 56 | 57 | /// Add a stream message while capping the stream at a maxlength. 58 | /// 59 | #[inline] 60 | fn xadd_maxlen< 61 | K: ToRedisArgs, 62 | ID: ToRedisArgs, 63 | F: ToRedisArgs, 64 | V: ToRedisArgs, 65 | RV: FromRedisValue, 66 | >( 67 | &mut self, 68 | key: K, 69 | maxlen: StreamMaxlen, 70 | id: ID, 71 | items: &[(F, V)], 72 | ) -> RedisResult { 73 | cmd("XADD") 74 | .arg(key) 75 | .arg(maxlen) 76 | .arg(id) 77 | .arg(items) 78 | .query(self) 79 | } 80 | 81 | // XADD key [MAXLEN [~|=] ] [rust BTreeMap] ... 82 | 83 | /// BTreeMap variant for adding a stream message while capping the stream at a maxlength. 84 | /// 85 | #[inline] 86 | fn xadd_maxlen_map( 87 | &mut self, 88 | key: K, 89 | maxlen: StreamMaxlen, 90 | id: ID, 91 | map: BTM, 92 | ) -> RedisResult { 93 | cmd("XADD") 94 | .arg(key) 95 | .arg(maxlen) 96 | .arg(id) 97 | .arg(map) 98 | .query(self) 99 | } 100 | 101 | // XCLAIM [ ] 102 | 103 | /// Claim pending, unacked messages, after some period of time, 104 | /// currently checked out by another consumer. 105 | /// 106 | /// This method only accepts the must-have arguments for claiming messages. 107 | /// If optional arguments are required, see `xclaim_options` below. 108 | /// 109 | #[inline] 110 | fn xclaim( 111 | &mut self, 112 | key: K, 113 | group: G, 114 | consumer: C, 115 | min_idle_time: MIT, 116 | ids: &[ID], 117 | ) -> RedisResult { 118 | cmd("XCLAIM") 119 | .arg(key) 120 | .arg(group) 121 | .arg(consumer) 122 | .arg(min_idle_time) 123 | .arg(ids) 124 | .query(self) 125 | } 126 | 127 | // XCLAIM 128 | // [IDLE ] [TIME ] [RETRYCOUNT ] 129 | // [FORCE] [JUSTID] 130 | 131 | /// This is the optional arguments version for claiming unacked, pending messages 132 | /// currently checked out by another consumer. 133 | /// 134 | /// ```no_run 135 | /// use redis_streams::{client_open,Connection,RedisResult,StreamCommands,StreamClaimOptions,StreamClaimReply}; 136 | /// let client = client_open("redis://127.0.0.1/0").unwrap(); 137 | /// let mut con = client.get_connection().unwrap(); 138 | /// 139 | /// // Claim all pending messages for key "k1", 140 | /// // from group "g1", checked out by consumer "c1" 141 | /// // for 10ms with RETRYCOUNT 2 and FORCE 142 | /// 143 | /// let opts = StreamClaimOptions::default() 144 | /// .with_force() 145 | /// .retry(2); 146 | /// let results: RedisResult = 147 | /// con.xclaim_options("k1", "g1", "c1", 10, &["0"], opts); 148 | /// 149 | /// // All optional arguments return a `Result` with one exception: 150 | /// // Passing JUSTID returns only the message `id` and omits the HashMap for each message. 151 | /// 152 | /// let opts = StreamClaimOptions::default() 153 | /// .with_justid(); 154 | /// let results: RedisResult> = 155 | /// con.xclaim_options("k1", "g1", "c1", 10, &["0"], opts); 156 | /// ``` 157 | /// 158 | #[inline] 159 | fn xclaim_options< 160 | K: ToRedisArgs, 161 | G: ToRedisArgs, 162 | C: ToRedisArgs, 163 | MIT: ToRedisArgs, 164 | ID: ToRedisArgs, 165 | RV: FromRedisValue, 166 | >( 167 | &mut self, 168 | key: K, 169 | group: G, 170 | consumer: C, 171 | min_idle_time: MIT, 172 | ids: &[ID], 173 | options: StreamClaimOptions, 174 | ) -> RedisResult { 175 | cmd("XCLAIM") 176 | .arg(key) 177 | .arg(group) 178 | .arg(consumer) 179 | .arg(min_idle_time) 180 | .arg(ids) 181 | .arg(options) 182 | .query(self) 183 | } 184 | 185 | // XDEL [ ... ] 186 | 187 | /// Deletes a list of `id`s for a given stream `key`. 188 | /// 189 | #[inline] 190 | fn xdel( 191 | &mut self, 192 | key: K, 193 | ids: &[ID], 194 | ) -> RedisResult { 195 | cmd("XDEL").arg(key).arg(ids).query(self) 196 | } 197 | 198 | // XGROUP CREATE 199 | 200 | /// This command is used for creating a consumer `group`. It expects the stream key 201 | /// to already exist. Otherwise, use `xgroup_create_mkstream` if it doesn't. 202 | /// The `id` is the starting message id all consumers should read from. Use `$` If you want 203 | /// all consumers to read from the last message added to stream. 204 | /// 205 | #[inline] 206 | fn xgroup_create( 207 | &mut self, 208 | key: K, 209 | group: G, 210 | id: ID, 211 | ) -> RedisResult { 212 | cmd("XGROUP") 213 | .arg("CREATE") 214 | .arg(key) 215 | .arg(group) 216 | .arg(id) 217 | .query(self) 218 | } 219 | 220 | // XGROUP CREATE [MKSTREAM] 221 | 222 | /// This is the alternate version for creating a consumer `group` 223 | /// which makes the stream if it doesn't exist. 224 | /// 225 | #[inline] 226 | fn xgroup_create_mkstream< 227 | K: ToRedisArgs, 228 | G: ToRedisArgs, 229 | ID: ToRedisArgs, 230 | RV: FromRedisValue, 231 | >( 232 | &mut self, 233 | key: K, 234 | group: G, 235 | id: ID, 236 | ) -> RedisResult { 237 | cmd("XGROUP") 238 | .arg("CREATE") 239 | .arg(key) 240 | .arg(group) 241 | .arg(id) 242 | .arg("MKSTREAM") 243 | .query(self) 244 | } 245 | 246 | // XGROUP SETID 247 | 248 | /// Alter which `id` you want consumers to begin reading from an existing 249 | /// consumer `group`. 250 | /// 251 | #[inline] 252 | fn xgroup_setid( 253 | &mut self, 254 | key: K, 255 | group: G, 256 | id: ID, 257 | ) -> RedisResult { 258 | cmd("XGROUP") 259 | .arg("SETID") 260 | .arg(key) 261 | .arg(group) 262 | .arg(id) 263 | .query(self) 264 | } 265 | 266 | // XGROUP DESTROY 267 | 268 | /// Destroy an existing consumer `group` for a given stream `key` 269 | /// 270 | #[inline] 271 | fn xgroup_destroy( 272 | &mut self, 273 | key: K, 274 | group: G, 275 | ) -> RedisResult { 276 | cmd("XGROUP").arg("DESTROY").arg(key).arg(group).query(self) 277 | } 278 | 279 | // XGROUP DELCONSUMER 280 | 281 | /// This deletes a `consumer` from an existing consumer `group` 282 | /// for given stream `key. 283 | /// 284 | #[inline] 285 | fn xgroup_delconsumer( 286 | &mut self, 287 | key: K, 288 | group: G, 289 | consumer: C, 290 | ) -> RedisResult { 291 | cmd("XGROUP") 292 | .arg("DELCONSUMER") 293 | .arg(key) 294 | .arg(group) 295 | .arg(consumer) 296 | .query(self) 297 | } 298 | 299 | // XINFO CONSUMERS 300 | 301 | /// This returns all info details about 302 | /// which consumers have read messages for given consumer `group`. 303 | /// Take note of the StreamInfoConsumersReply return type. 304 | /// 305 | /// *It's possible this return value might not contain new fields 306 | /// added by Redis in future versions.* 307 | /// 308 | #[inline] 309 | fn xinfo_consumers( 310 | &mut self, 311 | key: K, 312 | group: G, 313 | ) -> RedisResult { 314 | cmd("XINFO") 315 | .arg("CONSUMERS") 316 | .arg(key) 317 | .arg(group) 318 | .query(self) 319 | } 320 | 321 | // XINFO GROUPS 322 | 323 | /// Returns all consumer `group`s created for a given stream `key`. 324 | /// Take note of the StreamInfoGroupsReply return type. 325 | /// 326 | /// *It's possible this return value might not contain new fields 327 | /// added by Redis in future versions.* 328 | /// 329 | #[inline] 330 | fn xinfo_groups(&mut self, key: K) -> RedisResult { 331 | cmd("XINFO").arg("GROUPS").arg(key).query(self) 332 | } 333 | 334 | // XINFO STREAM 335 | 336 | /// Returns info about high-level stream details 337 | /// (first & last message `id`, length, number of groups, etc.) 338 | /// Take note of the StreamInfoStreamReply return type. 339 | /// 340 | /// *It's possible this return value might not contain new fields 341 | /// added by Redis in future versions.* 342 | /// 343 | #[inline] 344 | fn xinfo_stream(&mut self, key: K) -> RedisResult { 345 | cmd("XINFO").arg("STREAM").arg(key).query(self) 346 | } 347 | 348 | // XLEN 349 | /// Returns the number of messages for a given stream `key`. 350 | /// 351 | #[inline] 352 | fn xlen(&mut self, key: K) -> RedisResult { 353 | cmd("XLEN").arg(key).query(self) 354 | } 355 | 356 | // XPENDING [ []] 357 | 358 | /// This is a basic version of making XPENDING command calls which only 359 | /// passes a stream `key` and consumer `group` and it 360 | /// returns details about which consumers have pending messages 361 | /// that haven't been acked. 362 | /// 363 | /// You can use this method along with 364 | /// `xclaim` or `xclaim_options` for determining which messages 365 | /// need to be retried. 366 | /// 367 | /// Take note of the StreamPendingReply return type. 368 | /// 369 | #[inline] 370 | fn xpending( 371 | &mut self, 372 | key: K, 373 | group: G, 374 | ) -> RedisResult { 375 | cmd("XPENDING").arg(key).arg(group).query(self) 376 | } 377 | 378 | // XPENDING 379 | 380 | /// This XPENDING version returns a list of all messages over the range. 381 | /// You can use this for paginating pending messages (but without the message HashMap). 382 | /// 383 | /// Start and end follow the same rules `xrange` args. Set start to `-` 384 | /// and end to `+` for the entire stream. 385 | /// 386 | /// Take note of the StreamPendingCountReply return type. 387 | /// 388 | #[inline] 389 | fn xpending_count< 390 | K: ToRedisArgs, 391 | G: ToRedisArgs, 392 | S: ToRedisArgs, 393 | E: ToRedisArgs, 394 | C: ToRedisArgs, 395 | >( 396 | &mut self, 397 | key: K, 398 | group: G, 399 | start: S, 400 | end: E, 401 | count: C, 402 | ) -> RedisResult { 403 | cmd("XPENDING") 404 | .arg(key) 405 | .arg(group) 406 | .arg(start) 407 | .arg(end) 408 | .arg(count) 409 | .query(self) 410 | } 411 | 412 | // XPENDING 413 | 414 | /// An alternate version of `xpending_count` which filters by `consumer` name. 415 | /// 416 | /// Start and end follow the same rules `xrange` args. Set start to `-` 417 | /// and end to `+` for the entire stream. 418 | /// 419 | /// Take note of the StreamPendingCountReply return type. 420 | /// 421 | #[inline] 422 | fn xpending_consumer_count< 423 | K: ToRedisArgs, 424 | G: ToRedisArgs, 425 | S: ToRedisArgs, 426 | E: ToRedisArgs, 427 | C: ToRedisArgs, 428 | CN: ToRedisArgs, 429 | >( 430 | &mut self, 431 | key: K, 432 | group: G, 433 | start: S, 434 | end: E, 435 | count: C, 436 | consumer: CN, 437 | ) -> RedisResult { 438 | cmd("XPENDING") 439 | .arg(key) 440 | .arg(group) 441 | .arg(start) 442 | .arg(end) 443 | .arg(count) 444 | .arg(consumer) 445 | .query(self) 446 | } 447 | 448 | // XRANGE key start end 449 | 450 | /// Returns a range of messages in a given stream `key`. 451 | /// 452 | /// Set `start` to `-` to begin at the first message. 453 | /// Set `end` to `+` to end the most recent message. 454 | /// You can pass message `id` to both `start` and `end`. 455 | /// 456 | /// Take note of the StreamRangeReply return type. 457 | /// 458 | #[inline] 459 | fn xrange( 460 | &mut self, 461 | key: K, 462 | start: S, 463 | end: E, 464 | ) -> RedisResult { 465 | cmd("XRANGE").arg(key).arg(start).arg(end).query(self) 466 | } 467 | 468 | // XRANGE key - + 469 | 470 | /// A helper method for automatically returning all messages in a stream by `key`. 471 | /// **Use with caution!** 472 | /// 473 | #[inline] 474 | fn xrange_all(&mut self, key: K) -> RedisResult { 475 | cmd("XRANGE").arg(key).arg("-").arg("+").query(self) 476 | } 477 | 478 | // XRANGE key start end [COUNT ] 479 | 480 | /// A method for paginating a stream by `key`. 481 | /// 482 | #[inline] 483 | fn xrange_count( 484 | &mut self, 485 | key: K, 486 | start: S, 487 | end: E, 488 | count: C, 489 | ) -> RedisResult { 490 | cmd("XRANGE") 491 | .arg(key) 492 | .arg(start) 493 | .arg(end) 494 | .arg("COUNT") 495 | .arg(count) 496 | .query(self) 497 | } 498 | 499 | // XREAD STREAMS key_1 key_2 ... key_N ID_1 ID_2 ... ID_N 500 | 501 | /// Read a list of `id`s for each stream `key`. 502 | /// This is the basic form of reading streams. 503 | /// For more advanced control, like blocking, limiting, or reading by consumer `group`, 504 | /// see `xread_options`. 505 | /// 506 | #[inline] 507 | fn xread( 508 | &mut self, 509 | keys: &[K], 510 | ids: &[ID], 511 | ) -> RedisResult { 512 | cmd("XREAD").arg("STREAMS").arg(keys).arg(ids).query(self) 513 | } 514 | 515 | // XREAD [BLOCK ] [COUNT ] 516 | // STREAMS key_1 key_2 ... key_N 517 | // ID_1 ID_2 ... ID_N 518 | // XREADGROUP [BLOCK ] [COUNT ] [NOACK] [GROUP group-name consumer-name] 519 | // STREAMS key_1 key_2 ... key_N 520 | // ID_1 ID_2 ... ID_N 521 | 522 | /// This method handles setting optional arguments for 523 | /// `XREAD` or `XREADGROUP` Redis commands. 524 | /// ```no_run 525 | /// use redis_streams::{client_open,Connection,RedisResult,StreamCommands,StreamReadOptions,StreamReadReply}; 526 | /// let client = client_open("redis://127.0.0.1/0").unwrap(); 527 | /// let mut con = client.get_connection().unwrap(); 528 | /// 529 | /// // Read 10 messages from the start of the stream, 530 | /// // without registering as a consumer group. 531 | /// 532 | /// let opts = StreamReadOptions::default() 533 | /// .count(10); 534 | /// let results: RedisResult = 535 | /// con.xread_options(&["k1"], &["0"], opts); 536 | /// 537 | /// // Read all undelivered messages for a given 538 | /// // consumer group. Be advised: the consumer group must already 539 | /// // exist before making this call. Also note: we're passing 540 | /// // '>' as the id here, which means all undelivered messages. 541 | /// 542 | /// let opts = StreamReadOptions::default() 543 | /// .group("group-1", "consumer-1"); 544 | /// let results: RedisResult = 545 | /// con.xread_options(&["k1"], &[">"], opts); 546 | /// ``` 547 | /// 548 | #[inline] 549 | fn xread_options( 550 | &mut self, 551 | keys: &[K], 552 | ids: &[ID], 553 | options: StreamReadOptions, 554 | ) -> RedisResult { 555 | cmd(if options.read_only() { 556 | "XREAD" 557 | } else { 558 | "XREADGROUP" 559 | }) 560 | .arg(options) 561 | .arg("STREAMS") 562 | .arg(keys) 563 | .arg(ids) 564 | .query(self) 565 | } 566 | 567 | // XREVRANGE key end start 568 | 569 | /// This is the reverse version of `xrange`. 570 | /// The same rules apply for `start` and `end` here. 571 | /// 572 | #[inline] 573 | fn xrevrange( 574 | &mut self, 575 | key: K, 576 | end: E, 577 | start: S, 578 | ) -> RedisResult { 579 | cmd("XREVRANGE").arg(key).arg(end).arg(start).query(self) 580 | } 581 | 582 | // XREVRANGE key + - 583 | 584 | /// This is the reverse version of `xrange_all`. 585 | /// The same rules apply for `start` and `end` here. 586 | /// 587 | fn xrevrange_all(&mut self, key: K) -> RedisResult { 588 | cmd("XREVRANGE").arg(key).arg("+").arg("-").query(self) 589 | } 590 | 591 | // XREVRANGE key end start [COUNT ] 592 | 593 | /// This is the reverse version of `xrange_count`. 594 | /// The same rules apply for `start` and `end` here. 595 | /// 596 | #[inline] 597 | fn xrevrange_count( 598 | &mut self, 599 | key: K, 600 | end: E, 601 | start: S, 602 | count: C, 603 | ) -> RedisResult { 604 | cmd("XREVRANGE") 605 | .arg(key) 606 | .arg(end) 607 | .arg(start) 608 | .arg("COUNT") 609 | .arg(count) 610 | .query(self) 611 | } 612 | 613 | // XTRIM MAXLEN [~|=] (Same as XADD MAXLEN option) 614 | 615 | /// Trim a stream `key` to a MAXLEN count. 616 | /// 617 | #[inline] 618 | fn xtrim( 619 | &mut self, 620 | key: K, 621 | maxlen: StreamMaxlen, 622 | ) -> RedisResult { 623 | cmd("XTRIM").arg(key).arg(maxlen).query(self) 624 | } 625 | } 626 | 627 | impl StreamCommands for T where T: ConnectionLike {} 628 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "async-std" 5 | version = "1.5.0" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | dependencies = [ 8 | "async-task 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 9 | "crossbeam-channel 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 10 | "crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", 11 | "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", 12 | "futures-core 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 13 | "futures-io 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 14 | "futures-timer 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 15 | "kv-log-macro 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", 16 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 17 | "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 18 | "mio 0.6.22 (registry+https://github.com/rust-lang/crates.io-index)", 19 | "mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", 20 | "num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)", 21 | "once_cell 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 22 | "pin-project-lite 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", 23 | "pin-utils 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 24 | "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 25 | ] 26 | 27 | [[package]] 28 | name = "async-task" 29 | version = "1.3.1" 30 | source = "registry+https://github.com/rust-lang/crates.io-index" 31 | dependencies = [ 32 | "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", 33 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 34 | ] 35 | 36 | [[package]] 37 | name = "async-trait" 38 | version = "0.1.30" 39 | source = "registry+https://github.com/rust-lang/crates.io-index" 40 | dependencies = [ 41 | "proc-macro2 1.0.12 (registry+https://github.com/rust-lang/crates.io-index)", 42 | "quote 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", 43 | "syn 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", 44 | ] 45 | 46 | [[package]] 47 | name = "autocfg" 48 | version = "1.0.0" 49 | source = "registry+https://github.com/rust-lang/crates.io-index" 50 | 51 | [[package]] 52 | name = "bitflags" 53 | version = "1.0.4" 54 | source = "registry+https://github.com/rust-lang/crates.io-index" 55 | 56 | [[package]] 57 | name = "bytes" 58 | version = "0.5.4" 59 | source = "registry+https://github.com/rust-lang/crates.io-index" 60 | 61 | [[package]] 62 | name = "cfg-if" 63 | version = "0.1.10" 64 | source = "registry+https://github.com/rust-lang/crates.io-index" 65 | 66 | [[package]] 67 | name = "combine" 68 | version = "4.1.0" 69 | source = "registry+https://github.com/rust-lang/crates.io-index" 70 | dependencies = [ 71 | "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", 72 | "futures-util 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 73 | "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 74 | "pin-project-lite 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", 75 | "tokio 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", 76 | ] 77 | 78 | [[package]] 79 | name = "crossbeam-channel" 80 | version = "0.4.2" 81 | source = "registry+https://github.com/rust-lang/crates.io-index" 82 | dependencies = [ 83 | "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", 84 | "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 85 | ] 86 | 87 | [[package]] 88 | name = "crossbeam-deque" 89 | version = "0.7.3" 90 | source = "registry+https://github.com/rust-lang/crates.io-index" 91 | dependencies = [ 92 | "crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", 93 | "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", 94 | "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 95 | ] 96 | 97 | [[package]] 98 | name = "crossbeam-epoch" 99 | version = "0.8.2" 100 | source = "registry+https://github.com/rust-lang/crates.io-index" 101 | dependencies = [ 102 | "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 103 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 104 | "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", 105 | "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", 106 | "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 107 | "memoffset 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", 108 | "scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 109 | ] 110 | 111 | [[package]] 112 | name = "crossbeam-utils" 113 | version = "0.7.2" 114 | source = "registry+https://github.com/rust-lang/crates.io-index" 115 | dependencies = [ 116 | "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 117 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 118 | "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", 119 | ] 120 | 121 | [[package]] 122 | name = "dtoa" 123 | version = "0.4.3" 124 | source = "registry+https://github.com/rust-lang/crates.io-index" 125 | 126 | [[package]] 127 | name = "fnv" 128 | version = "1.0.6" 129 | source = "registry+https://github.com/rust-lang/crates.io-index" 130 | 131 | [[package]] 132 | name = "fuchsia-zircon" 133 | version = "0.3.3" 134 | source = "registry+https://github.com/rust-lang/crates.io-index" 135 | dependencies = [ 136 | "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", 137 | "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 138 | ] 139 | 140 | [[package]] 141 | name = "fuchsia-zircon-sys" 142 | version = "0.3.3" 143 | source = "registry+https://github.com/rust-lang/crates.io-index" 144 | 145 | [[package]] 146 | name = "futures" 147 | version = "0.3.5" 148 | source = "registry+https://github.com/rust-lang/crates.io-index" 149 | dependencies = [ 150 | "futures-channel 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 151 | "futures-core 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 152 | "futures-executor 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 153 | "futures-io 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 154 | "futures-sink 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 155 | "futures-task 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 156 | "futures-util 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 157 | ] 158 | 159 | [[package]] 160 | name = "futures-channel" 161 | version = "0.3.5" 162 | source = "registry+https://github.com/rust-lang/crates.io-index" 163 | dependencies = [ 164 | "futures-core 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 165 | "futures-sink 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 166 | ] 167 | 168 | [[package]] 169 | name = "futures-core" 170 | version = "0.3.5" 171 | source = "registry+https://github.com/rust-lang/crates.io-index" 172 | 173 | [[package]] 174 | name = "futures-executor" 175 | version = "0.3.5" 176 | source = "registry+https://github.com/rust-lang/crates.io-index" 177 | dependencies = [ 178 | "futures-core 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 179 | "futures-task 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 180 | "futures-util 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 181 | ] 182 | 183 | [[package]] 184 | name = "futures-io" 185 | version = "0.3.5" 186 | source = "registry+https://github.com/rust-lang/crates.io-index" 187 | 188 | [[package]] 189 | name = "futures-macro" 190 | version = "0.3.5" 191 | source = "registry+https://github.com/rust-lang/crates.io-index" 192 | dependencies = [ 193 | "proc-macro-hack 0.5.15 (registry+https://github.com/rust-lang/crates.io-index)", 194 | "proc-macro2 1.0.12 (registry+https://github.com/rust-lang/crates.io-index)", 195 | "quote 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", 196 | "syn 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", 197 | ] 198 | 199 | [[package]] 200 | name = "futures-sink" 201 | version = "0.3.5" 202 | source = "registry+https://github.com/rust-lang/crates.io-index" 203 | 204 | [[package]] 205 | name = "futures-task" 206 | version = "0.3.5" 207 | source = "registry+https://github.com/rust-lang/crates.io-index" 208 | dependencies = [ 209 | "once_cell 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 210 | ] 211 | 212 | [[package]] 213 | name = "futures-timer" 214 | version = "2.0.2" 215 | source = "registry+https://github.com/rust-lang/crates.io-index" 216 | 217 | [[package]] 218 | name = "futures-util" 219 | version = "0.3.5" 220 | source = "registry+https://github.com/rust-lang/crates.io-index" 221 | dependencies = [ 222 | "futures-channel 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 223 | "futures-core 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 224 | "futures-io 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 225 | "futures-macro 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 226 | "futures-sink 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 227 | "futures-task 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 228 | "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 229 | "pin-project 0.4.16 (registry+https://github.com/rust-lang/crates.io-index)", 230 | "pin-utils 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 231 | "proc-macro-hack 0.5.15 (registry+https://github.com/rust-lang/crates.io-index)", 232 | "proc-macro-nested 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 233 | "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 234 | ] 235 | 236 | [[package]] 237 | name = "getrandom" 238 | version = "0.1.14" 239 | source = "registry+https://github.com/rust-lang/crates.io-index" 240 | dependencies = [ 241 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 242 | "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", 243 | "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", 244 | ] 245 | 246 | [[package]] 247 | name = "hermit-abi" 248 | version = "0.1.12" 249 | source = "registry+https://github.com/rust-lang/crates.io-index" 250 | dependencies = [ 251 | "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", 252 | ] 253 | 254 | [[package]] 255 | name = "idna" 256 | version = "0.2.0" 257 | source = "registry+https://github.com/rust-lang/crates.io-index" 258 | dependencies = [ 259 | "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", 260 | "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", 261 | "unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", 262 | ] 263 | 264 | [[package]] 265 | name = "iovec" 266 | version = "0.1.4" 267 | source = "registry+https://github.com/rust-lang/crates.io-index" 268 | dependencies = [ 269 | "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", 270 | ] 271 | 272 | [[package]] 273 | name = "itoa" 274 | version = "0.4.3" 275 | source = "registry+https://github.com/rust-lang/crates.io-index" 276 | 277 | [[package]] 278 | name = "kernel32-sys" 279 | version = "0.2.2" 280 | source = "registry+https://github.com/rust-lang/crates.io-index" 281 | dependencies = [ 282 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 283 | "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 284 | ] 285 | 286 | [[package]] 287 | name = "kv-log-macro" 288 | version = "1.0.5" 289 | source = "registry+https://github.com/rust-lang/crates.io-index" 290 | dependencies = [ 291 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 292 | ] 293 | 294 | [[package]] 295 | name = "lazy_static" 296 | version = "1.3.0" 297 | source = "registry+https://github.com/rust-lang/crates.io-index" 298 | 299 | [[package]] 300 | name = "libc" 301 | version = "0.2.69" 302 | source = "registry+https://github.com/rust-lang/crates.io-index" 303 | 304 | [[package]] 305 | name = "log" 306 | version = "0.4.8" 307 | source = "registry+https://github.com/rust-lang/crates.io-index" 308 | dependencies = [ 309 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 310 | ] 311 | 312 | [[package]] 313 | name = "matches" 314 | version = "0.1.8" 315 | source = "registry+https://github.com/rust-lang/crates.io-index" 316 | 317 | [[package]] 318 | name = "maybe-uninit" 319 | version = "2.0.0" 320 | source = "registry+https://github.com/rust-lang/crates.io-index" 321 | 322 | [[package]] 323 | name = "memchr" 324 | version = "2.3.3" 325 | source = "registry+https://github.com/rust-lang/crates.io-index" 326 | 327 | [[package]] 328 | name = "memoffset" 329 | version = "0.5.4" 330 | source = "registry+https://github.com/rust-lang/crates.io-index" 331 | dependencies = [ 332 | "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 333 | ] 334 | 335 | [[package]] 336 | name = "mio" 337 | version = "0.6.22" 338 | source = "registry+https://github.com/rust-lang/crates.io-index" 339 | dependencies = [ 340 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 341 | "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 342 | "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 343 | "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 344 | "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 345 | "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", 346 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 347 | "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 348 | "net2 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)", 349 | "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 350 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 351 | ] 352 | 353 | [[package]] 354 | name = "mio-uds" 355 | version = "0.6.7" 356 | source = "registry+https://github.com/rust-lang/crates.io-index" 357 | dependencies = [ 358 | "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 359 | "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", 360 | "mio 0.6.22 (registry+https://github.com/rust-lang/crates.io-index)", 361 | ] 362 | 363 | [[package]] 364 | name = "miow" 365 | version = "0.2.1" 366 | source = "registry+https://github.com/rust-lang/crates.io-index" 367 | dependencies = [ 368 | "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 369 | "net2 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)", 370 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 371 | "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 372 | ] 373 | 374 | [[package]] 375 | name = "net2" 376 | version = "0.2.34" 377 | source = "registry+https://github.com/rust-lang/crates.io-index" 378 | dependencies = [ 379 | "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", 380 | "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", 381 | "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 382 | ] 383 | 384 | [[package]] 385 | name = "num_cpus" 386 | version = "1.13.0" 387 | source = "registry+https://github.com/rust-lang/crates.io-index" 388 | dependencies = [ 389 | "hermit-abi 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", 390 | "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", 391 | ] 392 | 393 | [[package]] 394 | name = "once_cell" 395 | version = "1.3.1" 396 | source = "registry+https://github.com/rust-lang/crates.io-index" 397 | 398 | [[package]] 399 | name = "percent-encoding" 400 | version = "2.1.0" 401 | source = "registry+https://github.com/rust-lang/crates.io-index" 402 | 403 | [[package]] 404 | name = "pin-project" 405 | version = "0.4.16" 406 | source = "registry+https://github.com/rust-lang/crates.io-index" 407 | dependencies = [ 408 | "pin-project-internal 0.4.16 (registry+https://github.com/rust-lang/crates.io-index)", 409 | ] 410 | 411 | [[package]] 412 | name = "pin-project-internal" 413 | version = "0.4.16" 414 | source = "registry+https://github.com/rust-lang/crates.io-index" 415 | dependencies = [ 416 | "proc-macro2 1.0.12 (registry+https://github.com/rust-lang/crates.io-index)", 417 | "quote 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", 418 | "syn 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", 419 | ] 420 | 421 | [[package]] 422 | name = "pin-project-lite" 423 | version = "0.1.5" 424 | source = "registry+https://github.com/rust-lang/crates.io-index" 425 | 426 | [[package]] 427 | name = "pin-utils" 428 | version = "0.1.0" 429 | source = "registry+https://github.com/rust-lang/crates.io-index" 430 | 431 | [[package]] 432 | name = "ppv-lite86" 433 | version = "0.2.6" 434 | source = "registry+https://github.com/rust-lang/crates.io-index" 435 | 436 | [[package]] 437 | name = "proc-macro-hack" 438 | version = "0.5.15" 439 | source = "registry+https://github.com/rust-lang/crates.io-index" 440 | 441 | [[package]] 442 | name = "proc-macro-nested" 443 | version = "0.1.4" 444 | source = "registry+https://github.com/rust-lang/crates.io-index" 445 | 446 | [[package]] 447 | name = "proc-macro2" 448 | version = "1.0.12" 449 | source = "registry+https://github.com/rust-lang/crates.io-index" 450 | dependencies = [ 451 | "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 452 | ] 453 | 454 | [[package]] 455 | name = "quote" 456 | version = "1.0.4" 457 | source = "registry+https://github.com/rust-lang/crates.io-index" 458 | dependencies = [ 459 | "proc-macro2 1.0.12 (registry+https://github.com/rust-lang/crates.io-index)", 460 | ] 461 | 462 | [[package]] 463 | name = "rand" 464 | version = "0.7.3" 465 | source = "registry+https://github.com/rust-lang/crates.io-index" 466 | dependencies = [ 467 | "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", 468 | "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", 469 | "rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 470 | "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 471 | "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 472 | ] 473 | 474 | [[package]] 475 | name = "rand_chacha" 476 | version = "0.2.2" 477 | source = "registry+https://github.com/rust-lang/crates.io-index" 478 | dependencies = [ 479 | "ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 480 | "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 481 | ] 482 | 483 | [[package]] 484 | name = "rand_core" 485 | version = "0.5.1" 486 | source = "registry+https://github.com/rust-lang/crates.io-index" 487 | dependencies = [ 488 | "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", 489 | ] 490 | 491 | [[package]] 492 | name = "rand_hc" 493 | version = "0.2.0" 494 | source = "registry+https://github.com/rust-lang/crates.io-index" 495 | dependencies = [ 496 | "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 497 | ] 498 | 499 | [[package]] 500 | name = "redis" 501 | version = "0.16.0" 502 | source = "registry+https://github.com/rust-lang/crates.io-index" 503 | dependencies = [ 504 | "async-std 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", 505 | "async-trait 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", 506 | "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", 507 | "combine 4.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 508 | "dtoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", 509 | "futures-util 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 510 | "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", 511 | "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 512 | "pin-project-lite 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", 513 | "sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", 514 | "tokio 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", 515 | "tokio-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 516 | "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 517 | ] 518 | 519 | [[package]] 520 | name = "redis-streams" 521 | version = "0.1.0" 522 | dependencies = [ 523 | "futures 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 524 | "net2 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)", 525 | "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", 526 | "redis 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", 527 | ] 528 | 529 | [[package]] 530 | name = "scopeguard" 531 | version = "1.1.0" 532 | source = "registry+https://github.com/rust-lang/crates.io-index" 533 | 534 | [[package]] 535 | name = "sha1" 536 | version = "0.6.0" 537 | source = "registry+https://github.com/rust-lang/crates.io-index" 538 | 539 | [[package]] 540 | name = "slab" 541 | version = "0.4.2" 542 | source = "registry+https://github.com/rust-lang/crates.io-index" 543 | 544 | [[package]] 545 | name = "smallvec" 546 | version = "0.6.9" 547 | source = "registry+https://github.com/rust-lang/crates.io-index" 548 | 549 | [[package]] 550 | name = "syn" 551 | version = "1.0.19" 552 | source = "registry+https://github.com/rust-lang/crates.io-index" 553 | dependencies = [ 554 | "proc-macro2 1.0.12 (registry+https://github.com/rust-lang/crates.io-index)", 555 | "quote 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", 556 | "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 557 | ] 558 | 559 | [[package]] 560 | name = "tokio" 561 | version = "0.2.20" 562 | source = "registry+https://github.com/rust-lang/crates.io-index" 563 | dependencies = [ 564 | "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", 565 | "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", 566 | "futures-core 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 567 | "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 568 | "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", 569 | "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", 570 | "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 571 | "mio 0.6.22 (registry+https://github.com/rust-lang/crates.io-index)", 572 | "mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", 573 | "pin-project-lite 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", 574 | ] 575 | 576 | [[package]] 577 | name = "tokio-util" 578 | version = "0.3.1" 579 | source = "registry+https://github.com/rust-lang/crates.io-index" 580 | dependencies = [ 581 | "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", 582 | "futures-core 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 583 | "futures-sink 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 584 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", 585 | "pin-project-lite 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", 586 | "tokio 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", 587 | ] 588 | 589 | [[package]] 590 | name = "unicode-bidi" 591 | version = "0.3.4" 592 | source = "registry+https://github.com/rust-lang/crates.io-index" 593 | dependencies = [ 594 | "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", 595 | ] 596 | 597 | [[package]] 598 | name = "unicode-normalization" 599 | version = "0.1.8" 600 | source = "registry+https://github.com/rust-lang/crates.io-index" 601 | dependencies = [ 602 | "smallvec 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", 603 | ] 604 | 605 | [[package]] 606 | name = "unicode-xid" 607 | version = "0.2.0" 608 | source = "registry+https://github.com/rust-lang/crates.io-index" 609 | 610 | [[package]] 611 | name = "url" 612 | version = "2.1.1" 613 | source = "registry+https://github.com/rust-lang/crates.io-index" 614 | dependencies = [ 615 | "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 616 | "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", 617 | "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 618 | ] 619 | 620 | [[package]] 621 | name = "wasi" 622 | version = "0.9.0+wasi-snapshot-preview1" 623 | source = "registry+https://github.com/rust-lang/crates.io-index" 624 | 625 | [[package]] 626 | name = "winapi" 627 | version = "0.2.8" 628 | source = "registry+https://github.com/rust-lang/crates.io-index" 629 | 630 | [[package]] 631 | name = "winapi" 632 | version = "0.3.8" 633 | source = "registry+https://github.com/rust-lang/crates.io-index" 634 | dependencies = [ 635 | "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 636 | "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 637 | ] 638 | 639 | [[package]] 640 | name = "winapi-build" 641 | version = "0.1.1" 642 | source = "registry+https://github.com/rust-lang/crates.io-index" 643 | 644 | [[package]] 645 | name = "winapi-i686-pc-windows-gnu" 646 | version = "0.4.0" 647 | source = "registry+https://github.com/rust-lang/crates.io-index" 648 | 649 | [[package]] 650 | name = "winapi-x86_64-pc-windows-gnu" 651 | version = "0.4.0" 652 | source = "registry+https://github.com/rust-lang/crates.io-index" 653 | 654 | [[package]] 655 | name = "ws2_32-sys" 656 | version = "0.2.1" 657 | source = "registry+https://github.com/rust-lang/crates.io-index" 658 | dependencies = [ 659 | "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", 660 | "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 661 | ] 662 | 663 | [metadata] 664 | "checksum async-std 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "538ecb01eb64eecd772087e5b6f7540cbc917f047727339a472dafed2185b267" 665 | "checksum async-task 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0ac2c016b079e771204030951c366db398864f5026f84a44dafb0ff20f02085d" 666 | "checksum async-trait 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)" = "da71fef07bc806586090247e971229289f64c210a278ee5ae419314eb386b31d" 667 | "checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" 668 | "checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" 669 | "checksum bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" 670 | "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 671 | "checksum combine 4.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9d79eb8c0bfd05a68f8b6195b27c4f2e042f86d52da032817f89a3847e0495ed" 672 | "checksum crossbeam-channel 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "cced8691919c02aac3cb0a1bc2e9b73d89e832bf9a06fc579d4e71b68a2da061" 673 | "checksum crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" 674 | "checksum crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" 675 | "checksum crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" 676 | "checksum dtoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6d301140eb411af13d3115f9a562c85cc6b541ade9dfa314132244aaee7489dd" 677 | "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" 678 | "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" 679 | "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" 680 | "checksum futures 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "1e05b85ec287aac0dc34db7d4a569323df697f9c55b99b15d6b4ef8cde49f613" 681 | "checksum futures-channel 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5" 682 | "checksum futures-core 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399" 683 | "checksum futures-executor 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "10d6bb888be1153d3abeb9006b11b02cf5e9b209fda28693c31ae1e4e012e314" 684 | "checksum futures-io 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789" 685 | "checksum futures-macro 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d0b5a30a4328ab5473878237c447333c093297bded83a4983d10f4deea240d39" 686 | "checksum futures-sink 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc" 687 | "checksum futures-task 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626" 688 | "checksum futures-timer 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a1de7508b218029b0f01662ed8f61b1c964b3ae99d6f25462d0f55a595109df6" 689 | "checksum futures-util 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6" 690 | "checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" 691 | "checksum hermit-abi 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "61565ff7aaace3525556587bd2dc31d4a07071957be715e63ce7b1eccf51a8f4" 692 | "checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" 693 | "checksum iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" 694 | "checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b" 695 | "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" 696 | "checksum kv-log-macro 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "2a2d3beed37e5483887d81eb39de6de03a8346531410e1306ca48a9a89bd3a51" 697 | "checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14" 698 | "checksum libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)" = "99e85c08494b21a9054e7fe1374a732aeadaff3980b6990b94bfd3a70f690005" 699 | "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" 700 | "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" 701 | "checksum maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" 702 | "checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" 703 | "checksum memoffset 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b4fc2c02a7e374099d4ee95a193111f72d2110197fe200272371758f6c3643d8" 704 | "checksum mio 0.6.22 (registry+https://github.com/rust-lang/crates.io-index)" = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" 705 | "checksum mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "966257a94e196b11bb43aca423754d87429960a768de9414f3691d6957abf125" 706 | "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" 707 | "checksum net2 0.2.34 (registry+https://github.com/rust-lang/crates.io-index)" = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" 708 | "checksum num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" 709 | "checksum once_cell 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b1c601810575c99596d4afc46f78a678c80105117c379eb3650cf99b8a21ce5b" 710 | "checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 711 | "checksum pin-project 0.4.16 (registry+https://github.com/rust-lang/crates.io-index)" = "81d480cb4e89522ccda96d0eed9af94180b7a5f93fb28f66e1fd7d68431663d1" 712 | "checksum pin-project-internal 0.4.16 (registry+https://github.com/rust-lang/crates.io-index)" = "a82996f11efccb19b685b14b5df818de31c1edcee3daa256ab5775dd98e72feb" 713 | "checksum pin-project-lite 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f7505eeebd78492e0f6108f7171c4948dbb120ee8119d9d77d0afa5469bef67f" 714 | "checksum pin-utils 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 715 | "checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" 716 | "checksum proc-macro-hack 0.5.15 (registry+https://github.com/rust-lang/crates.io-index)" = "0d659fe7c6d27f25e9d80a1a094c223f5246f6a6596453e09d7229bf42750b63" 717 | "checksum proc-macro-nested 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8e946095f9d3ed29ec38de908c22f95d9ac008e424c7bcae54c75a79c527c694" 718 | "checksum proc-macro2 1.0.12 (registry+https://github.com/rust-lang/crates.io-index)" = "8872cf6f48eee44265156c111456a700ab3483686b3f96df4cf5481c89157319" 719 | "checksum quote 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4c1f4b0efa5fc5e8ceb705136bfee52cfdb6a4e3509f770b478cd6ed434232a7" 720 | "checksum rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 721 | "checksum rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 722 | "checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 723 | "checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 724 | "checksum redis 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b94c6247d45d78d24481a5b7aca146f414ec0f5e39e175f294d1876b943eeeb" 725 | "checksum scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 726 | "checksum sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" 727 | "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" 728 | "checksum smallvec 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c4488ae950c49d403731982257768f48fada354a5203fe81f9bb6f43ca9002be" 729 | "checksum syn 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)" = "e8e5aa70697bb26ee62214ae3288465ecec0000f05182f039b477001f08f5ae7" 730 | "checksum tokio 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)" = "05c1d570eb1a36f0345a5ce9c6c6e665b70b73d11236912c0b477616aeec47b1" 731 | "checksum tokio-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" 732 | "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" 733 | "checksum unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "141339a08b982d942be2ca06ff8b076563cbe223d1befd5450716790d44e2426" 734 | "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" 735 | "checksum url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" 736 | "checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 737 | "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" 738 | "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" 739 | "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" 740 | "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 741 | "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 742 | "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" 743 | --------------------------------------------------------------------------------