Skip to content

Commit 5c110fb

Browse files
committed
0.0.1
1 parent 7424e65 commit 5c110fb

File tree

11 files changed

+202
-100
lines changed

11 files changed

+202
-100
lines changed

.github/workflows/main.yml

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Continuous integration
2+
3+
on: [push, pull_request]
4+
5+
env:
6+
CARGO_TERM_COLOR: always
7+
8+
jobs:
9+
check:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions-rs/toolchain@v1
14+
with:
15+
profile: minimal
16+
toolchain: nightly
17+
override: true
18+
- uses: actions-rs/cargo@v1
19+
with:
20+
command: check
21+
args: --all-features
22+
23+
build:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v3
27+
- uses: actions-rs/toolchain@v1
28+
with:
29+
profile: minimal
30+
toolchain: nightly
31+
override: true
32+
- uses: actions-rs/cargo@v1
33+
with:
34+
command: build
35+
args: --all-features
36+
37+
test:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v3
41+
- uses: actions-rs/toolchain@v1
42+
with:
43+
profile: minimal
44+
toolchain: nightly
45+
override: true
46+
- uses: actions-rs/cargo@v1
47+
with:
48+
command: test
49+
args: --all-features
50+
51+
fmt:
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v3
55+
- uses: actions-rs/toolchain@v1
56+
with:
57+
profile: minimal
58+
toolchain: nightly
59+
override: true
60+
- run: rustup component add rustfmt
61+
- uses: actions-rs/cargo@v1
62+
with:
63+
command: fmt
64+
args: --all -- --check
65+
66+
clippy:
67+
runs-on: ubuntu-latest
68+
steps:
69+
- uses: actions/checkout@v3
70+
- uses: actions-rs/toolchain@v1
71+
with:
72+
profile: minimal
73+
toolchain: nightly
74+
override: true
75+
- run: rustup component add clippy
76+
- uses: actions-rs/cargo@v1
77+
with:
78+
command: clippy
79+
args: -- -D -warnings

Cargo.toml

+3-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "binator_network"
33
authors = ["Stargateur"]
4-
version = "0.0.0"
4+
version = "0.0.1"
55
description = "binator network"
66
license = "Zlib"
77
repository = "https://github.com/binator/network"
@@ -19,11 +19,7 @@ include = [
1919
]
2020

2121
[dependencies]
22-
binator_core = "0.0.2"
23-
binator_utils = "0.0.0"
24-
binator_base = "0.0.0"
25-
binator_context = "0.0.0"
26-
binator_number = "0.0.0"
22+
binator = "0.3.0"
2723
serde = { version = "1.0", optional = true, features = ["derive"] }
2824
const_format = { version = "0.2", features = ["const_generics"] }
2925
paste = "1"
@@ -37,11 +33,7 @@ pretty_assertions = "1"
3733
derive-new = "0.5"
3834
derive_more = "0.99"
3935

40-
binator_core = { version = "0.0.2", features = ["tracing"]}
41-
binator_utils = { version = "0.0.0", features = ["tracing"]}
42-
binator_base = { version = "0.0.0", features = ["tracing"]}
43-
binator_context = { version = "0.0.0", features = ["tracing"]}
44-
binator_number = { version = "0.0.0", features = ["tracing"]}
36+
binator = { version = "0.3.0", features = ["tracing"]}
4537

4638
tracing = "0.1"
4739
tracing-subscriber = {version = "0.3", features = ["env-filter", "fmt"]}

src/ether_type.rs

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
use binator_base::octet;
2-
use binator_core::{
1+
use binator::{
2+
base::octet,
3+
utils::{
4+
Utils,
5+
UtilsAtom,
6+
},
37
Contexting,
48
CoreAtom,
59
Parse,
610
Parsed,
711
Streaming,
812
};
9-
use binator_utils::{
10-
Utils,
11-
UtilsAtom,
12-
};
1313

1414
use crate::struct_variants;
1515

@@ -128,8 +128,10 @@ where
128128

129129
#[cfg(test)]
130130
mod tests {
131-
use binator_context::Ignore;
132-
use binator_core::Parsed;
131+
use binator::{
132+
context::Ignore,
133+
Parsed,
134+
};
133135

134136
use super::EtherType;
135137

src/ethernet.rs

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
//! Handles parsing of Ethernet headers
22
3-
use binator_base::octet;
4-
use binator_core::{
3+
use binator::{
4+
base::octet,
5+
utils::{
6+
Utils,
7+
UtilsAtom,
8+
},
59
Contexting,
610
CoreAtom,
711
Parse,
812
Parsed,
913
Streaming,
1014
Success,
1115
};
12-
use binator_utils::{
13-
Utils,
14-
UtilsAtom,
15-
};
1616

1717
use crate::ether_type::{
1818
ether_type,
@@ -94,8 +94,10 @@ where
9494

9595
#[cfg(test)]
9696
mod tests {
97-
use binator_context::Ignore;
98-
use binator_core::Parsed;
97+
use binator::{
98+
context::Ignore,
99+
Parsed,
100+
};
99101

100102
use super::{
101103
EtherType,

src/ip_addr.rs

+24-7
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,25 @@ use std::net::{
88
Ipv6Addr,
99
};
1010

11-
use binator_base::*;
12-
use binator_core::*;
13-
use binator_number::*;
14-
use binator_utils::*;
11+
use binator::{
12+
base::{
13+
is,
14+
to_digit,
15+
uint_radix,
16+
BaseAtom,
17+
IntRadixAtom,
18+
Radix,
19+
},
20+
utils::{
21+
Utils,
22+
UtilsAtom,
23+
},
24+
Contexting,
25+
CoreAtom,
26+
Parse,
27+
Parsed,
28+
Streaming,
29+
};
1530

1631
/// Atom of ip_addr parser
1732
#[derive(Debug, Clone, PartialEq, Eq)]
@@ -453,9 +468,11 @@ mod tests {
453468
str::FromStr,
454469
};
455470

456-
use binator_base::*;
457-
use binator_context::Tree;
458-
use binator_core::*;
471+
use binator::{
472+
base::*,
473+
context::Tree,
474+
*,
475+
};
459476
use derive_more::{
460477
Display,
461478
From,

src/ip_protocol.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
//! Handles parsing of Internet Protocol fields (shared between ipv4 and ipv6)
22
3-
use binator_base::octet;
4-
use binator_core::{
3+
use binator::{
4+
base::octet,
5+
utils::Utils,
56
Contexting,
67
CoreAtom,
78
Parse,
89
Parsed,
910
Streaming,
1011
};
11-
use binator_utils::Utils;
1212

1313
use crate::struct_variants;
1414

@@ -313,8 +313,10 @@ where
313313

314314
#[cfg(test)]
315315
mod tests {
316-
use binator_context::Ignore;
317-
use binator_core::Parsed;
316+
use binator::{
317+
context::Ignore,
318+
Parsed,
319+
};
318320

319321
use super::IPProtocol;
320322

src/ipv4.rs

+16-14
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@ use std::{
88
net::Ipv4Addr,
99
};
1010

11-
use binator_base::{
12-
any,
13-
nbit,
14-
octet,
15-
NBit,
16-
};
17-
use binator_core::{
18-
Acc,
11+
use binator::{
12+
base::{
13+
any,
14+
nbit,
15+
octet,
16+
NBit,
17+
},
18+
utils::{
19+
Acc,
20+
Utils,
21+
UtilsAtom,
22+
},
1923
Contexting,
2024
CoreAtom,
2125
Parse,
2226
Parsed,
2327
Streaming,
2428
Success,
2529
};
26-
use binator_utils::{
27-
Utils,
28-
UtilsAtom,
29-
};
3030

3131
use crate::ip_protocol::{
3232
self,
@@ -274,8 +274,10 @@ where
274274
mod tests {
275275
use std::net::Ipv4Addr;
276276

277-
use binator_context::Ignore;
278-
use binator_core::Parsed;
277+
use binator::{
278+
context::Ignore,
279+
Parsed,
280+
};
279281

280282
use super::{
281283
IPProtocol,

src/ipv6.rs

+14-12
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@ use std::{
88
net::Ipv6Addr,
99
};
1010

11-
use binator_base::{
12-
nbit,
13-
octet,
14-
NBit,
15-
};
16-
use binator_core::{
11+
use binator::{
12+
base::{
13+
nbit,
14+
octet,
15+
NBit,
16+
},
17+
utils::{
18+
Utils,
19+
UtilsAtom,
20+
},
1721
Contexting,
1822
CoreAtom,
1923
Parse,
2024
Parsed,
2125
Streaming,
2226
Success,
2327
};
24-
use binator_utils::{
25-
Utils,
26-
UtilsAtom,
27-
};
2828

2929
use crate::ip_protocol::{
3030
self,
@@ -178,8 +178,10 @@ where
178178
mod tests {
179179
use std::net::Ipv6Addr;
180180

181-
use binator_context::Ignore;
182-
use binator_core::Parsed;
181+
use binator::{
182+
context::Ignore,
183+
Parsed,
184+
};
183185
use pretty_assertions::assert_eq;
184186

185187
use super::{

src/lib.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -120,19 +120,19 @@ pub(crate) use struct_variants;
120120
mod tests {
121121
use core::fmt::Debug;
122122

123-
use binator_base::{
124-
all,
125-
BaseAtom,
126-
};
127-
use binator_context::Tree;
128-
use binator_core::{
123+
use binator::{
124+
base::{
125+
all,
126+
BaseAtom,
127+
IntRadixAtom,
128+
},
129+
context::Tree,
130+
utils::UtilsAtom,
129131
CoreAtom,
130132
Parse,
131133
Streaming,
132134
Success,
133135
};
134-
use binator_number::IntRadixAtom;
135-
use binator_utils::UtilsAtom;
136136
use derive_more::{
137137
Display,
138138
From,

0 commit comments

Comments
 (0)