diskann_disk/build/chunking/continuation/
continuation_tracker.rs1use std::time::Duration;
7
8pub enum ContinuationGrant {
10 Continue,
11 Yield(Duration),
12 Stop,
13}
14
15pub trait ContinuationTrackerTrait: Send + Sync + ContinuationCheckerTraitClone {
18 fn get_continuation_grant(&self) -> ContinuationGrant;
19}
20
21#[derive(Default, Clone)]
24pub struct NaiveContinuationTracker {}
25
26impl ContinuationTrackerTrait for NaiveContinuationTracker {
27 fn get_continuation_grant(&self) -> ContinuationGrant {
28 ContinuationGrant::Continue
29 }
30}
31
32pub trait ContinuationCheckerTraitClone {
33 fn clone_box(&self) -> Box<dyn ContinuationTrackerTrait>;
34}
35
36impl<T> ContinuationCheckerTraitClone for T
37where
38 T: 'static + ContinuationTrackerTrait + Clone,
39{
40 fn clone_box(&self) -> Box<dyn ContinuationTrackerTrait> {
41 Box::new(self.clone())
42 }
43}