1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! # rediserde - A Redis RESP protocol serializer/deserializer for Rust
//! This library provides functionality to serialize and deserialize data
//! in the Redis RESP (Redis Serialization Protocol) format using serde.
//! Supports all RESP2 and RESP3 data types.
//!
//! ## RESP Data Types
//! For more information on RESP data types and their uses in this crate, see the documentation for
//! [`RespDataKind`] and refer to the [Redis RESP documentation](https://redis.io/docs/latest/protocol-spec/).
//!
//! ## Quick Start
//! Especially easy to use with [`serde::Serialize`] and [`serde::Deserialize`] derive macros.
//!
//! ```
//! use rediserde::{from_str, to_string};
//! use serde::{Deserialize, Serialize};
//!
//! #[derive(Debug, Serialize, Deserialize, PartialEq)]
//! struct Person {
//! name: String,
//! age: u32,
//! }
//!
//! let person = Person {
//! name: "Alice".to_string(),
//! age: 30,
//! };
//!
//! let serialized = to_string(&person).unwrap();
//! let deserialized: Person = from_str(&serialized).unwrap();
//! let deserialized_raw: Person = from_str("%2\r\n+name\r\n+Alice\r\n+age\r\n:30\r\n").unwrap();
//! assert_eq!(deserialized, person);
//! assert_eq!(deserialized_raw, person);
//! assert_eq!(deserialized, person);
//! ```
//!
//! But may also be used directly with [`to_string`], [`to_bytes`], [`from_str`], and [`from_bytes`].
//!
//! ```
//! use rediserde::{from_str, to_string};
//! let data = "*3\r\n:1\r\n:2\r\n:3\r\n";
//! let deserialized: Vec<u32> = from_str(&data).unwrap();
//! assert_eq!(deserialized, vec![1, 2, 3]);
//! let serialized = to_string(&deserialized).unwrap();
//! assert_eq!(serialized, data);
//! ```
//!
pub use ;
pub use ;
pub use RespDataKind;
pub use ;
pub const CRLF: & = b"\r\n";
pub const CRLF_STR: &str = "\r\n";