pub struct Cache<Key, Row> { /* private fields */ }Expand description
Owns the mounted window plus an optional single pin. Other leaving rows are disposed immediately. The widget adapter resolves the focused stable key; this is not a keep-alive cache of every row ever visited.
Implementations§
Source§impl<Key: Clone + Eq + Hash, Row> Cache<Key, Row>
impl<Key: Clone + Eq + Hash, Row> Cache<Key, Row>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn row(&self, key: &Key) -> Option<&Row>
pub fn order(&self) -> &[Key]
pub fn reconcile( &mut self, range: Range<usize>, revision: u64, host: &mut impl RowHost<Key = Key, Row = Row>, ) -> Result<ReconcileStats, Error>
Sourcepub fn reconcile_pinned(
&mut self,
range: Range<usize>,
revision: u64,
pin: Option<(usize, Key)>,
host: &mut impl RowHost<Key = Key, Row = Row>,
) -> Result<ReconcileStats, Error>
pub fn reconcile_pinned( &mut self, range: Range<usize>, revision: u64, pin: Option<(usize, Key)>, host: &mut impl RowHost<Key = Key, Row = Row>, ) -> Result<ReconcileStats, Error>
Reconcile the window plus at most one indexed stable key. The caller resolves/validates the pin without scanning the source. It is part of the same order/LIS reconciliation, never a separate historical cache.
pub fn clear(&mut self, host: &mut impl RowHost<Key = Key, Row = Row>)
Trait Implementations§
Auto Trait Implementations§
impl<Key, Row> Forget for Cache<Key, Row>
impl<Key, Row> Freeze for Cache<Key, Row>where
*const u8 is !null: Freeze,
PhantomData<(Key, Entry<Row>)>: Freeze,
PhantomData<Key>: Freeze,
Key: Freeze,
impl<Key, Row> Move for Cache<Key, Row>
impl<Key, Row> RefUnwindSafe for Cache<Key, Row>where
Key: RefUnwindSafe,
Row: RefUnwindSafe,
impl<Key, Row> Send for Cache<Key, Row>
impl<Key, Row> Sync for Cache<Key, Row>
impl<Key, Row> Unpin for Cache<Key, Row>
impl<Key, Row> UnsafeUnpin for Cache<Key, Row>where
*const u8 is !null: UnsafeUnpin,
PhantomData<(Key, Entry<Row>)>: UnsafeUnpin,
PhantomData<Key>: UnsafeUnpin,
Key: UnsafeUnpin,
impl<Key, Row> UnwindSafe for Cache<Key, Row>
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