feat(client): add run status and packet count helpers

This commit is contained in:
Nils Andreas Svee committed 2026-04-28 23:34:34 +07:00
1 parent 13c32cd753
commit 2f3d92ad2b
1 file changed
+16
+16
View File
@@ -322,6 +322,22 @@ impl Client {
Ok(events)
}
pub(crate) fn is_run_complete(&self) -> bool {
let Some(session) = self.session.as_ref() else {
return matches!(
self.phase,
ClientPhase::Closed | ClientPhase::NoTestCompleted
);
};
session.sending_done && session.pending.len() == 0
}
pub(crate) fn packets_sent(&self) -> u64 {
self.session
.as_ref()
.map_or(0, |session| session.packets_sent)
}
fn process_received_packet(
&mut self,
packet: &[u8],