refactor(irtt-client): gate functions that are only used with tokio enabled
This commit is contained in:
1 parent
36eaa90e2a
commit
33fe01f252
2 files changed
+4
No files matched your search
@@ -79,6 +79,7 @@ impl ProbeSchedule {
|
|||||||
Ok(self.finish_commit(scheduled_at, next_send_at))
|
Ok(self.finish_commit(scheduled_at, next_send_at))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(any(feature = "tokio", test))]
|
||||||
pub(crate) fn preflight_managed_commit(
|
pub(crate) fn preflight_managed_commit(
|
||||||
&self,
|
&self,
|
||||||
scheduled_at: Instant,
|
scheduled_at: Instant,
|
||||||
@@ -122,6 +123,7 @@ fn next_probe_deadline(
|
|||||||
.ok_or(ClientError::DurationOverflow)
|
.ok_or(ClientError::DurationOverflow)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(any(feature = "tokio", test))]
|
||||||
pub(crate) fn advance_cadence(
|
pub(crate) fn advance_cadence(
|
||||||
deadline: Instant,
|
deadline: Instant,
|
||||||
interval: Duration,
|
interval: Duration,
|
||||||
@@ -161,6 +163,7 @@ pub(crate) fn advance_cadence(
|
|||||||
Ok((scheduled_at, next_at, elapsed_slots))
|
Ok((scheduled_at, next_at, elapsed_slots))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(any(feature = "tokio", test))]
|
||||||
fn duration_from_nanos(nanos: u128) -> Result<Duration, ClientError> {
|
fn duration_from_nanos(nanos: u128) -> Result<Duration, ClientError> {
|
||||||
const NANOS_PER_SECOND: u128 = 1_000_000_000;
|
const NANOS_PER_SECOND: u128 = 1_000_000_000;
|
||||||
let seconds =
|
let seconds =
|
||||||
|
|||||||
@@ -488,6 +488,7 @@ impl SessionMachine {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(any(feature = "tokio", test))]
|
||||||
pub(crate) fn packets_sent(&self) -> u64 {
|
pub(crate) fn packets_sent(&self) -> u64 {
|
||||||
match &self.state {
|
match &self.state {
|
||||||
MachineState::Open(session) => session.packets_sent,
|
MachineState::Open(session) => session.packets_sent,
|
||||||
|
|||||||
Reference in new issue
Block a user