docs: document client public API
This commit is contained in:
1 parent
8fd0b803e9
commit
01c10e2e0d
8 files changed
+395
-1
No files matched your search
@@ -1,12 +1,20 @@
|
||||
use std::time::{Instant, SystemTime};
|
||||
|
||||
/// Client-side timestamp captured in both wall-clock and monotonic time.
|
||||
///
|
||||
/// Wall-clock time is used for protocol timestamp comparison and one-way delay
|
||||
/// calculations. Monotonic time is used for elapsed client-side timing such as
|
||||
/// RTT, scheduling, and timeouts.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub struct ClientTimestamp {
|
||||
/// System wall-clock time.
|
||||
pub wall: SystemTime,
|
||||
/// Monotonic timestamp sampled alongside [`wall`](Self::wall).
|
||||
pub mono: Instant,
|
||||
}
|
||||
|
||||
impl ClientTimestamp {
|
||||
/// Capture the current wall-clock and monotonic timestamps.
|
||||
pub fn now() -> Self {
|
||||
Self {
|
||||
wall: SystemTime::now(),
|
||||
|
||||
Reference in new issue
Block a user