more shifting
This commit is contained in:
parent
60e0bb3bbb
commit
bbc64fde3b
11 changed files with 22 additions and 16 deletions
3
Cargo.lock
generated
3
Cargo.lock
generated
|
@ -664,7 +664,6 @@ dependencies = [
|
|||
"anyhow",
|
||||
"async-trait",
|
||||
"bitflags",
|
||||
"bstr",
|
||||
"bytes",
|
||||
"chrono",
|
||||
"derive_builder",
|
||||
|
@ -685,8 +684,10 @@ name = "panorama-proto-common"
|
|||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bstr",
|
||||
"bytes",
|
||||
"format-bytes",
|
||||
"log",
|
||||
"nom",
|
||||
]
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ rfc6154 = [] # list
|
|||
anyhow = "1.0.42"
|
||||
async-trait = "0.1.51"
|
||||
bitflags = "1.2.1"
|
||||
bstr = "0.2.15"
|
||||
bytes = "1.0.1"
|
||||
chrono = "0.4.19"
|
||||
derive_builder = "0.10.2"
|
||||
|
|
|
@ -2,12 +2,11 @@ use std::io::{self};
|
|||
|
||||
use bytes::{BufMut, BytesMut};
|
||||
use nom::Needed;
|
||||
use panorama_proto_common::Bytes;
|
||||
use panorama_proto_common::{convert_error, Bytes};
|
||||
use tokio_util::codec::{Decoder, Encoder};
|
||||
|
||||
use crate::proto::{
|
||||
command::Command,
|
||||
convert_error::convert_error,
|
||||
response::{Response, Tag},
|
||||
rfc3501::response as parse_response,
|
||||
};
|
||||
|
|
|
@ -2,11 +2,6 @@
|
|||
|
||||
#![allow(non_snake_case, dead_code)]
|
||||
|
||||
// utils
|
||||
#[macro_use]
|
||||
mod macros;
|
||||
pub mod convert_error;
|
||||
|
||||
// data types
|
||||
pub mod command;
|
||||
pub mod response;
|
||||
|
|
|
@ -10,6 +10,8 @@ workspace = ".."
|
|||
|
||||
[dependencies]
|
||||
anyhow = "1.0.42"
|
||||
bstr = "0.2.15"
|
||||
bytes = "1.0.1"
|
||||
format-bytes = "0.2.2"
|
||||
log = "0.4.14"
|
||||
nom = "6.2.1"
|
|
@ -1,10 +1,15 @@
|
|||
#[macro_use]
|
||||
extern crate anyhow;
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
mod bytes;
|
||||
mod convert_error;
|
||||
mod formatter;
|
||||
mod parsers;
|
||||
mod rule;
|
||||
|
||||
pub use crate::bytes::{Bytes, ShitCompare, ShitNeededForParsing};
|
||||
pub use crate::convert_error::convert_error;
|
||||
pub use crate::formatter::quote_string;
|
||||
pub use crate::parsers::{byte, never, parse_u32, satisfy, skip, tagi, take, take_while1, VResult};
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
use crate::{Bytes, VResult};
|
||||
|
||||
/// Defines a new parser rule that operates on [`Bytes`] and produces a [`VResult`].
|
||||
#[macro_export]
|
||||
macro_rules! rule {
|
||||
($vis:vis $name:ident : $ret:ty => $expr:expr) => {
|
||||
$vis fn $name (
|
|
@ -2,3 +2,4 @@
|
|||
//! ---
|
||||
//!
|
||||
//! Grammar from <https://datatracker.ietf.org/doc/html/rfc5321>
|
||||
|
||||
|
|
Loading…
Reference in a new issue