-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: move `decode-mut` to `bytes` * feat: range-based frame types * feat: separate `Owned` and `Bytes` frame variants * feat: codec interfaces * feat: `FromResp2` and `FromResp3` type conversion traits * feat: fuzzing * feat: criterion benchmark scaffolding * fix: CI
- Loading branch information
Showing
58 changed files
with
12,446 additions
and
7,595 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,87 @@ | ||
version: 2 | ||
|
||
jobs: | ||
tests-default: | ||
build-docs: | ||
docker: | ||
- image: cimg/rust:1.57.0 | ||
- image: cimg/rust:1.77.0 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Clear the cargo git cache | ||
command: rm -rf ~/.cargo/git/* && rm -rf ~/.cargo/registry/cache/* | ||
name: Install nightly | ||
command: rustup install nightly | ||
- run: | ||
name: Run tests with default features | ||
command: cargo clean && eval `ssh-agent` && ssh-add ~/.ssh/id_rsa && cargo test --release | ||
tests-indexmap: | ||
docker: | ||
- image: cimg/rust:1.57.0 | ||
name: Build documentation | ||
command: tests/doc.sh | ||
tests-codec: | ||
machine: | ||
image: ubuntu-2204:2022.10.2 | ||
docker_layer_caching: true | ||
resource_class: medium | ||
environment: | ||
REDIS_VERSION: 7.2.4 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Clear the cargo git cache | ||
command: rm -rf ~/.cargo/git/* && rm -rf ~/.cargo/registry/cache/* | ||
name: Run tests with codec features | ||
command: source tests/environ && tests/codec/runner.sh | ||
tests-bytes: | ||
docker: | ||
- image: cimg/rust:1.77.0 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Run tests with indexmap features | ||
command: cargo clean && eval `ssh-agent` && ssh-add ~/.ssh/id_rsa && cargo test --release --features index-map | ||
tests-decode-mut: | ||
name: Run tests with bytes features | ||
command: cargo test --release --features "resp2 resp3 bytes codec convert" --lib | ||
tests-no-bytes: | ||
docker: | ||
- image: cimg/rust:1.57.0 | ||
- image: cimg/rust:1.77.0 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Clear the cargo git cache | ||
command: rm -rf ~/.cargo/git/* && rm -rf ~/.cargo/registry/cache/* | ||
name: Run tests without bytes or bytes_utils | ||
command: cargo test --release --features "resp2 resp3 convert" --lib | ||
tests-indexmap: | ||
docker: | ||
- image: cimg/rust:1.77.0 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Run tests with indexmap features | ||
command: cargo clean && eval `ssh-agent` && ssh-add ~/.ssh/id_rsa && cargo test --release --features decode-mut | ||
build_no_std: | ||
command: cargo test --release --features "index-map resp2 resp3 convert" --lib | ||
clippy-lint: | ||
docker: | ||
- image: cimg/rust:1.77.0 | ||
environment: | ||
CARGO_NET_GIT_FETCH_WITH_CLI: true | ||
steps: | ||
- checkout | ||
- run: | ||
name: Clippy | ||
command: cargo clippy --features "bytes convert codec std resp2 resp3" --lib --tests --benches -- -Dwarnings | ||
build-no-std: | ||
docker: | ||
- image: cimg/rust:1.57.0 | ||
- image: cimg/rust:1.77.0 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Switch to nightly for using unstable feature avoid-dev-deps | ||
command: rustup default nightly | ||
- run: | ||
name: Clear the cargo git cache | ||
command: rm -rf ~/.cargo/git/* && rm -rf ~/.cargo/registry/cache/* | ||
- run: | ||
name: Add cross compile target | ||
command: rustup target add thumbv7m-none-eabi | ||
- run: | ||
name: Verifies successful build for no_std target | ||
command: cargo clean && eval `ssh-agent` && ssh-add ~/.ssh/id_rsa && cargo build -Z avoid-dev-deps --release --no-default-features --features libm,hashbrown,alloc --target=thumbv7m-none-eabi | ||
command: cargo clean && cargo build -Z avoid-dev-deps --release --no-default-features --features resp2,resp3,convert,libm,hashbrown,alloc --target=thumbv7m-none-eabi | ||
|
||
|
||
workflows: | ||
version: 2 | ||
build: | ||
jobs: | ||
- tests-default | ||
- tests-bytes | ||
- tests-no-bytes | ||
- tests-codec | ||
- tests-indexmap | ||
- tests-decode-mut | ||
- build_no_std | ||
- build-no-std | ||
- clippy-lint | ||
- build-docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
/target | ||
**/*.rs.bk | ||
Cargo.lock | ||
process.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,77 @@ | ||
[package] | ||
authors = ["Alec Embke <[email protected]>"] | ||
description = "Structs and functions to implement the Redis protocol." | ||
description = "An implementation of the RESP2 and RESP3 protocols." | ||
homepage = "https://github.com/aembke/redis-protocol.rs" | ||
keywords = ["redis", "protocol", "nom", "resp", "no_std"] | ||
keywords = ["redis", "protocol", "RESP", "no_std"] | ||
license = "MIT" | ||
name = "redis-protocol" | ||
readme = "README.md" | ||
repository = "https://github.com/aembke/redis-protocol.rs" | ||
version = "4.1.0" | ||
edition = "2018" | ||
version = "5.0.0" | ||
edition = "2021" | ||
exclude = ["fuzz", ".circleci", "benches"] | ||
|
||
[badges.maintenance] | ||
status = "actively-developed" | ||
|
||
[badges.travis-ci] | ||
branch = "main" | ||
repository = "aembke/redis-protocol.rs" | ||
[package.metadata.docs.rs] | ||
features = [ | ||
"bytes", | ||
"std", | ||
"codec", | ||
"convert", | ||
"resp2", | ||
"resp3" | ||
] | ||
rustdoc-args = ["--cfg", "docsrs"] | ||
|
||
[dependencies] | ||
bytes = { version = "1.1", default-features = false } | ||
bytes-utils = { version = "0.1.2", default-features = false } | ||
cookie-factory = { version = "0.3", default-features = false } | ||
crc16 = "0.4" | ||
indexmap = { version = "1.6", optional = true } | ||
bytes = { version = "1.1", default-features = false, optional = true } | ||
bytes-utils = { version = "0.1", default-features = false, optional = true } | ||
cookie-factory = { version = "=0.3.2", default-features = false } | ||
crc16 = { version = "0.4" } | ||
indexmap = { version = "2.2", optional = true } | ||
log = "0.4" | ||
nom = { version = "7.1", default-features = false } | ||
libm = { version = "0.2.2", optional = true } | ||
hashbrown = { version = "0.13.2", optional = true } | ||
libm = { version = "0.2", optional = true } | ||
hashbrown = { version = "0.14", optional = true } | ||
tokio-util = { version = "0.7", features = ["codec"], optional = true } | ||
|
||
[dev-dependencies] | ||
rand = "0.5" | ||
tokio-util = { version = "0.6", features = ["codec"] } | ||
tokio = { version = "1.12", features = ["full"] } | ||
itertools = "0.10" | ||
pretty_env_logger = "0.4" | ||
rand = "0.8" | ||
tokio = { version = "1.36", features = ["full"] } | ||
pretty_env_logger = "0.5" | ||
futures = "0.3" | ||
itertools = "0.12" | ||
criterion = { version = "0.4", features = ["html_reports"] } | ||
|
||
[features] | ||
default = ["std"] | ||
default = ["std", "resp2", "resp3"] | ||
resp2 = [] | ||
resp3 = [] | ||
index-map = ["indexmap"] | ||
bytes = ["dep:bytes", "bytes-utils"] | ||
decode-logs = [] | ||
decode-mut = [] | ||
alloc = ["nom/alloc"] | ||
std = ["bytes/default", "bytes-utils/std", "cookie-factory/default", "nom/default"] | ||
std = ["cookie-factory/default", "nom/default"] | ||
codec = ["tokio-util", "bytes", "resp2", "resp3"] | ||
convert = [] | ||
|
||
[lib] | ||
doc = true | ||
doctest = true | ||
name = "redis_protocol" | ||
test = true | ||
|
||
[profile] | ||
[profile.bench] | ||
codegen-units = 16 | ||
debug = false | ||
debug-assertions = false | ||
incremental = false | ||
opt-level = 3 | ||
overflow-checks = false | ||
rpath = false | ||
#[[bench]] | ||
#name = "resp2_decode" | ||
#harness = false | ||
|
||
#[[bench]] | ||
#name = "resp2_encode" | ||
#harness = false | ||
|
||
#[[bench]] | ||
#name = "resp3_encode" | ||
#harness = false | ||
|
||
#[[bench]] | ||
#name = "resp3_decode" | ||
#harness = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.