socketio_rs/
ack.rs

1use std::time::Duration;
2
3use tokio::time::Instant;
4
5use crate::callback::Callback;
6
7/// Represents an `Ack` as given back to the caller. Holds the internal `id` as
8/// well as the current ack'ed state. Holds data which will be accessible as
9/// soon as the ack'ed state is set to true. An `Ack` that didn't get ack'ed
10/// won't contain data.
11#[derive(Debug)]
12pub(crate) struct Ack<C> {
13    pub id: AckId,
14    pub timeout: Duration,
15    pub time_started: Instant,
16    pub callback: Callback<C>,
17}
18
19pub type AckId = usize;