Skip to content

packet: Use Bytes instead of an array in Packet #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ bs58 = { version = "0.5.1", default-features = false }
bv = "0.11.1"
bytemuck = "1.21.0"
bytemuck_derive = "1.8.1"
bytes = { version = "1.10", features = ["serde"] }
cfg_eval = "0.1.2"
chrono = { version = "0.4.39", default-features = false }
console = "0.15.10"
Expand Down
3 changes: 2 additions & 1 deletion frozen-abi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ edition = { workspace = true }

[dependencies]
bs58 = { workspace = true, features = ["alloc"] }
bytes = { workspace = true, optional = true }
bv = { workspace = true, features = ["serde"] }
log = { workspace = true, features = ["std"] }
serde = { workspace = true, features = ["rc"] }
Expand All @@ -34,7 +35,7 @@ serde_with = { workspace = true, features = ["macros"] }
default = []
# activate the frozen-abi feature when we actually want to do frozen-abi testing,
# otherwise leave it off because it requires nightly Rust
frozen-abi = []
frozen-abi = ["bytes"]

[lints]
workspace = true
7 changes: 7 additions & 0 deletions frozen-abi/src/abi_example.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use {
crate::abi_digester::{AbiDigester, DigestError, DigestResult},
bytes::Bytes,
log::*,
serde::Serialize,
std::any::type_name,
Expand Down Expand Up @@ -507,6 +508,12 @@ impl AbiExample for IpAddr {
}
}

impl AbiExample for Bytes {
fn example() -> Self {
Bytes::new()
}
}

// This is a control flow indirection needed for digesting all variants of an enum.
//
// All of types (including non-enums) will be processed by this trait, albeit the
Expand Down
1 change: 1 addition & 0 deletions packet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ edition = { workspace = true }
[dependencies]
bincode = { workspace = true, optional = true }
bitflags = { workspace = true }
bytes = { workspace = true }
cfg_eval = { workspace = true, optional = true }
serde = { workspace = true, optional = true }
serde_derive = { workspace = true, optional = true }
Expand Down
Loading
Loading