Skip to content

Commit 16be963

Browse files
authored
make more types public (#59)
1 parent b7bab20 commit 16be963

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/frame.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//! Provides a type representing a Redis protocol frame as well as utilities for
2+
//! parsing frames from a byte array.
3+
14
use bytes::{Buf, Bytes};
25
use std::convert::TryInto;
36
use std::fmt;
@@ -17,7 +20,7 @@ pub enum Frame {
1720
}
1821

1922
#[derive(Debug)]
20-
pub(crate) enum Error {
23+
pub enum Error {
2124
/// Not enough data is available to parse a message
2225
Incomplete,
2326

@@ -60,7 +63,7 @@ impl Frame {
6063
}
6164

6265
/// 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> {
6467
match get_u8(src)? {
6568
b'+' => {
6669
get_line(src)?;
@@ -100,7 +103,7 @@ impl Frame {
100103
}
101104

102105
/// 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> {
104107
match get_u8(src)? {
105108
b'+' => {
106109
// Read the line and convert it to `Vec<u8>`

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub use cmd::Command;
3333
mod connection;
3434
pub use connection::Connection;
3535

36-
mod frame;
36+
pub mod frame;
3737
pub use frame::Frame;
3838

3939
mod db;

0 commit comments

Comments
 (0)