mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 09:45:31 +00:00
use zerocopy in udp protocol, easy running transfer CI locally
This commit is contained in:
parent
af16a9e682
commit
0e12dd1b13
24 changed files with 783 additions and 652 deletions
|
|
@ -20,4 +20,5 @@ compact_str = "0.7"
|
|||
hex = "0.4"
|
||||
regex = "1"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
quickcheck = { version = "1", optional = true }
|
||||
quickcheck = { version = "1", optional = true }
|
||||
zerocopy = { version = "0.7", features = ["derive"] }
|
||||
|
|
@ -3,8 +3,24 @@ use std::{borrow::Cow, fmt::Display, sync::OnceLock};
|
|||
use compact_str::{format_compact, CompactString};
|
||||
use regex::bytes::Regex;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use zerocopy::{AsBytes, FromBytes, FromZeroes};
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
|
||||
#[derive(
|
||||
Debug,
|
||||
Clone,
|
||||
Copy,
|
||||
PartialEq,
|
||||
Eq,
|
||||
PartialOrd,
|
||||
Ord,
|
||||
Hash,
|
||||
Serialize,
|
||||
Deserialize,
|
||||
AsBytes,
|
||||
FromBytes,
|
||||
FromZeroes,
|
||||
)]
|
||||
#[repr(transparent)]
|
||||
pub struct PeerId(pub [u8; 20]);
|
||||
|
||||
impl PeerId {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue