Skip to main content

Cache

Struct Cache 

Source
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>

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn row(&self, key: &Key) -> Option<&Row>

Source

pub fn order(&self) -> &[Key]

Source

pub fn reconcile( &mut self, range: Range<usize>, revision: u64, host: &mut impl RowHost<Key = Key, Row = Row>, ) -> Result<ReconcileStats, Error>

Source

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.

Source

pub fn clear(&mut self, host: &mut impl RowHost<Key = Key, Row = Row>)

Trait Implementations§

Source§

impl<Key: Debug, Row: Debug> Debug for Cache<Key, Row>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Key: Clone + Eq + Hash, Row> Default for Cache<Key, Row>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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>
where Key: Send, RawTable<(Key, Entry<Row>)>: Send, RawVecInner: Send,

§

impl<Key, Row> Sync for Cache<Key, Row>
where Key: Sync, RawTable<(Key, Entry<Row>)>: Sync, RawVecInner: Sync,

§

impl<Key, Row> Unpin for Cache<Key, Row>
where Row: Unpin, Key: Unpin, *const u8 is !null: Unpin,

§

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>
where HashMap<Key, Entry<Row>>: UnwindSafe, RawVecInner: UnwindSafe, Key: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.