@@ -18,7 +18,7 @@ use crate::{cc::classic_cc::SlowStart, packet, rtt::RttEstimate, stats::Congesti
1818
1919/// The outcome of a single SEARCH evaluation.
2020#[ derive( Debug , PartialEq , Eq ) ]
21- pub enum Result {
21+ pub enum Outcome {
2222 /// Evaluation ran and slow start should be exited with the provided cwnd.
2323 Exit ( usize ) ,
2424 /// Evaluation ran and slow start should be continued.
@@ -273,15 +273,15 @@ impl Search {
273273
274274 /// Re-exports the internal `evaluate` function for use in tests.
275275 #[ cfg( test) ]
276- pub fn evaluate_test ( & self , rtt : Duration , curr_idx : usize , curr_cwnd : usize ) -> Result {
276+ pub fn evaluate_test ( & self , rtt : Duration , curr_idx : usize , curr_cwnd : usize ) -> Outcome {
277277 self . evaluate ( rtt, curr_idx, curr_cwnd)
278278 }
279279
280280 /// Evaluates whether SEARCH should exit slow start.
281281 ///
282- /// Returns [`Result ::Exit`] with the current cwnd if the normalized delivery-rate
282+ /// Returns [`Outcome ::Exit`] with the current cwnd if the normalized delivery-rate
283283 /// difference exceeds [`Self::THRESH`], or a non-exit variant explaining why not.
284- fn evaluate ( & self , rtt : Duration , curr_idx : usize , curr_cwnd : usize ) -> Result {
284+ fn evaluate ( & self , rtt : Duration , curr_idx : usize , curr_cwnd : usize ) -> Outcome {
285285 // Compute how many bins fit in the last RTT. Integer division implicitly floors that value,
286286 // so `prev_idx` might be too recent by a fraction of a bin. Said fraction is scaled to
287287 // `0..[Self::SCALE]` for interpolation in `compute_sent`.
@@ -290,11 +290,11 @@ impl Search {
290290
291291 if prev_idx <= Self :: W {
292292 qdebug ! ( "SEARCH: evaluate: not enough data for SEARCH evaluation (warming up)" ) ;
293- return Result :: WarmingUp ;
293+ return Outcome :: WarmingUp ;
294294 }
295295 if curr_idx - prev_idx >= Self :: EXTRA_BINS {
296296 qdebug ! ( "SEARCH: evaluate: not enough data for SEARCH evaluation (RTT inflated)" ) ;
297- return Result :: RttInflated ;
297+ return Outcome :: RttInflated ;
298298 }
299299
300300 let curr_delv = self . compute_delv ( curr_idx - Self :: W , curr_idx) ;
@@ -303,7 +303,7 @@ impl Search {
303303
304304 if prev_sent == 0 {
305305 qdebug ! ( "SEARCH: evaluate: prev_sent is zero, can't evaluate" ) ;
306- return Result :: ZeroSent ;
306+ return Outcome :: ZeroSent ;
307307 }
308308
309309 let diff = prev_sent. saturating_sub ( curr_delv) ;
@@ -315,13 +315,13 @@ impl Search {
315315 "SEARCH: evaluate: norm_diff {norm_diff} < THRESH {} --> continue" ,
316316 Self :: THRESH
317317 ) ;
318- return Result :: Continue ;
318+ return Outcome :: Continue ;
319319 }
320320 qdebug ! (
321321 "SEARCH: evaluate: norm_diff {norm_diff} >= THRESH {} --> exit" ,
322322 Self :: THRESH
323323 ) ;
324- Result :: Exit ( curr_cwnd)
324+ Outcome :: Exit ( curr_cwnd)
325325 }
326326}
327327
@@ -365,7 +365,7 @@ impl SlowStart for Search {
365365 //
366366 // <https://datatracker.ietf.org/doc/html/draft-chung-ccwg-search-09#section-3.2-17>
367367 match self . evaluate ( rtt, curr_idx, curr_cwnd) {
368- Result :: Exit ( cwnd) => Some ( cwnd) ,
368+ Outcome :: Exit ( cwnd) => Some ( cwnd) ,
369369 _ => None ,
370370 }
371371 }
0 commit comments