File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change
1
+ //! Provides a type representing a Redis protocol frame as well as utilities for
2
+ //! parsing frames from a byte array.
3
+
1
4
use bytes:: { Buf , Bytes } ;
2
5
use std:: convert:: TryInto ;
3
6
use std:: fmt;
@@ -17,7 +20,7 @@ pub enum Frame {
17
20
}
18
21
19
22
#[ derive( Debug ) ]
20
- pub ( crate ) enum Error {
23
+ pub enum Error {
21
24
/// Not enough data is available to parse a message
22
25
Incomplete ,
23
26
@@ -60,7 +63,7 @@ impl Frame {
60
63
}
61
64
62
65
/// Checks if an entire message can be decoded from `src`
63
- pub ( crate ) fn check ( src : & mut Cursor < & [ u8 ] > ) -> Result < ( ) , Error > {
66
+ pub fn check ( src : & mut Cursor < & [ u8 ] > ) -> Result < ( ) , Error > {
64
67
match get_u8 ( src) ? {
65
68
b'+' => {
66
69
get_line ( src) ?;
@@ -100,7 +103,7 @@ impl Frame {
100
103
}
101
104
102
105
/// The message has already been validated with `scan`.
103
- pub ( crate ) fn parse ( src : & mut Cursor < & [ u8 ] > ) -> Result < Frame , Error > {
106
+ pub fn parse ( src : & mut Cursor < & [ u8 ] > ) -> Result < Frame , Error > {
104
107
match get_u8 ( src) ? {
105
108
b'+' => {
106
109
// Read the line and convert it to `Vec<u8>`
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ pub use cmd::Command;
33
33
mod connection;
34
34
pub use connection:: Connection ;
35
35
36
- mod frame;
36
+ pub mod frame;
37
37
pub use frame:: Frame ;
38
38
39
39
mod db;
You can’t perform that action at this time.
0 commit comments