fix: add tokio time feature, make SendState/RecvState::new public

- tokio 'time' feature needed for tokio::time::interval in retransmit timer
- SendState::new and RecvState::new must be pub for use from main.rs
- prefix unused tx param with underscore
This commit is contained in:
2026-08-13 09:25:27 +00:00
parent 6f7367e36d
commit bf2915d8bd
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ path = "src/main.rs"
[dependencies] [dependencies]
libc = "0.2" libc = "0.2"
tokio = { version = "1", features = ["rt-multi-thread", "macros", "net", "sync", "io-util"] } tokio = { version = "1", features = ["rt-multi-thread", "macros", "net", "sync", "io-util", "time"] }
clap = { version = "4", features = ["derive"] } clap = { version = "4", features = ["derive"] }
pnet_datalink = "0.35" pnet_datalink = "0.35"
tracing = "0.1" tracing = "0.1"
+3 -3
View File
@@ -33,7 +33,7 @@ pub struct RecvState {
} }
impl SendState { impl SendState {
fn new() -> Self { pub fn new() -> Self {
SendState { SendState {
send_seq: 0, send_seq: 0,
acked_seq: 0, acked_seq: 0,
@@ -83,7 +83,7 @@ impl SendState {
} }
impl RecvState { impl RecvState {
fn new() -> Self { pub fn new() -> Self {
RecvState { RecvState {
expected_seq: 0, expected_seq: 0,
deliver_seq: 0, deliver_seq: 0,
@@ -155,7 +155,7 @@ pub async fn handle_data(
seq: u32, seq: u32,
ack_seq: u32, ack_seq: u32,
payload: &[u8], payload: &[u8],
tx: &TxChan, _tx: &TxChan,
) -> Result<bool, WriteError> { ) -> Result<bool, WriteError> {
let handle = { let handle = {
let store = store.lock().expect("store lock poisoned"); let store = store.lock().expect("store lock poisoned");