Struct SparseVirtualViewport
pub struct SparseVirtualViewport<K> { /* private fields */ }Expand description
Virtual geometry for collections whose logical item count is much larger than the set of resident keys.
Unlike VirtualViewport, this type does not store one entry per logical
row. Unmeasured rows share an estimate; only measured stable keys and their
prefix-sum deltas consume memory. The owning model resolves keys at visible
indices and indices for measured/anchored keys during reconciliation.
Implementations§
§impl<K> SparseVirtualViewport<K>
impl<K> SparseVirtualViewport<K>
pub fn new(estimated_height: f64) -> SparseVirtualViewport<K>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn resident_measurements(&self) -> usize
pub fn estimated_height(&self) -> f64
pub fn set_estimated_height(&mut self, height: f64)
pub fn set_minimum_height(&mut self, height: f64)
pub fn set_minimum_height(&mut self, height: f64)
Set a geometry floor without discarding authored estimates or stable measured heights. Lowering the floor restores those original values.
pub fn minimum_height(&self) -> f64
pub fn set_viewport(&mut self, height: f64)
pub fn viewport(&self) -> f64
pub fn set_overscan(&mut self, pixels: f64)
pub fn overscan(&self) -> f64
pub fn offset(&self) -> f64
pub fn set_offset(&mut self, offset: f64)
pub fn scroll_by(&mut self, delta: f64)
pub fn content_extent(&self) -> f64
pub fn max_offset(&self) -> f64
pub fn capture_anchor<F>(&self, key_at: F) -> Option<SparseAnchor<K>>
pub fn capture_anchor<F>(&self, key_at: F) -> Option<SparseAnchor<K>>
Capture the first visible stable key before a model mutation.
pub fn reconcile<F>(
&mut self,
count: usize,
index_of: F,
anchor: Option<&SparseAnchor<K>>,
)
pub fn reconcile<F>( &mut self, count: usize, index_of: F, anchor: Option<&SparseAnchor<K>>, )
Reconcile a new logical count. index_of is called only for resident
measured keys and the captured anchor, never for every logical row.
pub fn measure(&mut self, index: usize, key: K, height: f64) -> bool
pub fn measure(&mut self, index: usize, key: K, height: f64) -> bool
Store a measured height for the stable key currently at index.
pub fn remap_key(&mut self, old: &K, new: K) -> bool
pub fn remap_key(&mut self, old: &K, new: K) -> bool
Move a resident measurement to a replacement stable key without changing its logical position. Useful when a placeholder resolves to a real model id.
pub fn item_height(&self, index: usize) -> Option<f64>
pub fn item_top(&self, index: usize) -> Option<f64>
pub fn item_view_top(&self, index: usize) -> Option<f64>
pub fn visible_range(&self) -> Range<usize> ⓘ
pub fn hit_test(&self, viewport_y: f64) -> Option<usize>
pub fn scroll_to_index( &mut self, index: usize, alignment: ScrollAlignment, ) -> bool
Trait Implementations§
§impl<K> Clone for SparseVirtualViewport<K>where
K: Clone,
impl<K> Clone for SparseVirtualViewport<K>where
K: Clone,
§fn clone(&self) -> SparseVirtualViewport<K>
fn clone(&self) -> SparseVirtualViewport<K>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<K> Freeze for SparseVirtualViewport<K>
impl<K> RefUnwindSafe for SparseVirtualViewport<K>where
K: RefUnwindSafe,
impl<K> Send for SparseVirtualViewport<K>where
K: Send,
impl<K> Sync for SparseVirtualViewport<K>where
K: Sync,
impl<K> Unpin for SparseVirtualViewport<K>where
K: Unpin,
impl<K> UnsafeUnpin for SparseVirtualViewport<K>
impl<K> UnwindSafe for SparseVirtualViewport<K>where
K: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more