@@ -53,24 +53,22 @@ pub trait DocSet: Send {
53
53
54
54
/// Seeks to the target if possible and returns true if the target is in the DocSet.
55
55
///
56
- /// Implementations may choose to advance past the target if target does not exist.
57
- ///
58
56
/// DocSets that already have an efficient `seek` method don't need to implement `seek_exact`.
59
57
/// All wrapper DocSets should forward `seek_exact` to the underlying DocSet.
60
58
///
61
59
/// ## API Behaviour
62
60
/// If `seek_exact` is returning true, a call to `doc()` has to return target.
63
- /// If `seek_exact` is returning false, a call to `doc()` may return any doc and should not be
64
- /// used until `seek_exact` returns true again. The DocSet is considered to be in an invalid
65
- /// state until `seek_exact` returns true again.
61
+ /// If `seek_exact` is returning false, a call to `doc()` may return any doc between
62
+ /// the last doc that matched and target or a doc that is a valid next hit after target.
63
+ /// The DocSet is considered to be in an invalid state until `seek_exact` returns true again.
66
64
///
67
- /// target needs to be equal or larger than `doc` when in a valid state.
65
+ /// ` target` needs to be equal or larger than `doc` when in a valid state.
68
66
///
69
67
/// Consecutive calls are not allowed to have decreasing `target` values.
70
68
///
71
69
/// # Warning
72
70
/// This is an advanced API used by intersection. The API contract is tricky, avoid using it.
73
- fn seek_exact ( & mut self , target : DocId ) -> bool {
71
+ fn seek_into_the_danger_zone ( & mut self , target : DocId ) -> bool {
74
72
let current_doc = self . doc ( ) ;
75
73
if current_doc < target {
76
74
self . seek ( target) ;
@@ -175,8 +173,8 @@ impl DocSet for &mut dyn DocSet {
175
173
( * * self ) . seek ( target)
176
174
}
177
175
178
- fn seek_exact ( & mut self , target : DocId ) -> bool {
179
- ( * * self ) . seek_exact ( target)
176
+ fn seek_into_the_danger_zone ( & mut self , target : DocId ) -> bool {
177
+ ( * * self ) . seek_into_the_danger_zone ( target)
180
178
}
181
179
182
180
fn doc ( & self ) -> u32 {
@@ -211,9 +209,9 @@ impl<TDocSet: DocSet + ?Sized> DocSet for Box<TDocSet> {
211
209
unboxed. seek ( target)
212
210
}
213
211
214
- fn seek_exact ( & mut self , target : DocId ) -> bool {
212
+ fn seek_into_the_danger_zone ( & mut self , target : DocId ) -> bool {
215
213
let unboxed: & mut TDocSet = self . borrow_mut ( ) ;
216
- unboxed. seek_exact ( target)
214
+ unboxed. seek_into_the_danger_zone ( target)
217
215
}
218
216
219
217
fn fill_buffer ( & mut self , buffer : & mut [ DocId ; COLLECT_BLOCK_BUFFER_LEN ] ) -> usize {
0 commit comments