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

This commit is contained in:
Nils Andreas Svee committed 2026-05-10 20:56:43 +07:00
1 parent c5941d6383
commit 3ba4f56221
1 file changed
+16
+16
View File
@@ -322,6 +322,22 @@ impl Client {
Ok(events) 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( fn process_received_packet(
&mut self, &mut self,
packet: &[u8], packet: &[u8],