pub struct PragmaQueryCursor { /* private fields */ }Expand description
Monotonic query cursor for repeated pragma lookups.
Reuse a single cursor when querying offsets in non-decreasing order to avoid repeated binary searches over the pragma map.
Implementations§
Source§impl PragmaQueryCursor
impl PragmaQueryCursor
Sourcepub fn new() -> PragmaQueryCursor
pub fn new() -> PragmaQueryCursor
Create a new cursor positioned before the start of the map.
Sourcepub fn state_for_offset(
&mut self,
pragma_map: &[(Range<usize>, PragmaState)],
offset: usize,
) -> PragmaState
pub fn state_for_offset( &mut self, pragma_map: &[(Range<usize>, PragmaState)], offset: usize, ) -> PragmaState
Query state at offset assuming lookups are mostly non-decreasing.
If the caller queries an older offset, this falls back to a binary search and repositions the cursor.
Trait Implementations§
Source§impl Clone for PragmaQueryCursor
impl Clone for PragmaQueryCursor
Source§fn clone(&self) -> PragmaQueryCursor
fn clone(&self) -> PragmaQueryCursor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PragmaQueryCursor
impl Debug for PragmaQueryCursor
Source§impl Default for PragmaQueryCursor
impl Default for PragmaQueryCursor
Source§fn default() -> PragmaQueryCursor
fn default() -> PragmaQueryCursor
Returns the “default value” for a type. Read more
Source§impl PartialEq for PragmaQueryCursor
impl PartialEq for PragmaQueryCursor
impl Copy for PragmaQueryCursor
impl Eq for PragmaQueryCursor
impl StructuralPartialEq for PragmaQueryCursor
Auto Trait Implementations§
impl Freeze for PragmaQueryCursor
impl RefUnwindSafe for PragmaQueryCursor
impl Send for PragmaQueryCursor
impl Sync for PragmaQueryCursor
impl Unpin for PragmaQueryCursor
impl UnsafeUnpin for PragmaQueryCursor
impl UnwindSafe for PragmaQueryCursor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more