agilulf_protocol/
lib.rs

1//! This crate contains the most part of serialize and deserialize [Agilulf KV Protocol](https://github.com/YangKeao/Agilulf/blob/master/agilulf_protocol/README.md)
2//!
3//! The core function of this crate is provided by these methods:
4//!
5//! 1. `into_command_stream` in `request.rs`. This will convert a `TcpStream` into a `Stream<Command>`
6//!
7//! 2. `into_reply_sink` in `reply.rs`. This will convert a `TcpSink` into a `Sink<Reply>`
8//!
9//! 3. The implementation of `Into<Vec<u8>>` for `Command` and `Reply`. As this crate provides both
10//! serialization and deserialization for both client and server. So they are all needed.
11
12#![feature(async_await)]
13#![feature(test)]
14#![allow(clippy::needless_lifetimes)]
15#![feature(type_alias_enum_variants)]
16
17#[macro_use]
18extern crate quick_error;
19
20extern crate test;
21
22mod async_buffer;
23mod error;
24mod message;
25pub mod reply;
26pub mod request;
27mod slice;
28
29pub use slice::Slice;
30
31pub use reply::{Reply, Status};
32pub use request::{Command, DeleteCommand, GetCommand, PutCommand, ScanCommand};
33
34pub use error::database_error::{DatabaseError, Result as DatabaseResult};
35pub use error::protocol_error::{ProtocolError, Result};
36
37pub use async_buffer::{AsyncReadBuffer, AsyncWriteBuffer};