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 snapshot_at(
&mut self,
pragma_map: &PragmaMap,
offset: usize,
) -> PragmaSnapshot
pub fn snapshot_at( &mut self, pragma_map: &PragmaMap, offset: usize, ) -> PragmaSnapshot
Query state at offset assuming lookups are mostly non-decreasing.
This is the primary cursor API for the explicit pragma map. If the caller queries an older offset, this falls back to a binary search and repositions the cursor.
Sourcepub fn state_at(&mut self, pragma_map: &PragmaMap, offset: usize) -> PragmaState
pub fn state_at(&mut self, pragma_map: &PragmaMap, offset: usize) -> PragmaState
Query state at offset against the explicit pragma 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.
This legacy tuple API is retained for existing PragmaTracker callers.
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 (const: unstable) · 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
Source§fn eq(&self, other: &PragmaQueryCursor) -> bool
fn eq(&self, other: &PragmaQueryCursor) -> bool
Tests for
self and other values to be equal, and is used by ==.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