pub struct Layout { /* private fields */ }Implementations§
Source§impl Layout
impl Layout
pub fn new(heights: Heights, overscan: usize) -> Self
pub fn heights(&self) -> &Heights
pub fn heights_mut(&mut self) -> &mut Heights
pub fn window(&self, offset: f64, viewport: f64) -> Result<Window, Error>
pub fn anchor(&self, offset: f64) -> Result<Option<Anchor>, Error>
Sourcepub fn restore(&self, anchor: Anchor) -> Result<f64, Error>
pub fn restore(&self, anchor: Anchor) -> Result<f64, Error>
For prepend/reorder, the data adapter first resolves the anchor’s stable key to its new index. No full data scan is performed during scrolling.
pub fn measure( &mut self, index: usize, height: f64, anchor: Option<Anchor>, ) -> Result<(bool, Option<f64>), Error>
Sourcepub fn splice(
&mut self,
range: Range<usize>,
inserted: usize,
estimate: f64,
anchor: Option<Anchor>,
) -> Result<Option<f64>, Error>
pub fn splice( &mut self, range: Range<usize>, inserted: usize, estimate: f64, anchor: Option<Anchor>, ) -> Result<Option<f64>, Error>
Preserve the item under the viewport across a positional data splice. If the anchored item is removed, choose the next surviving row, or the final row when removing the tail. Arbitrary reorder uses stable keys.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Layout
impl Freeze for Layout
impl RefUnwindSafe for Layout
impl Send for Layout
impl Sync for Layout
impl Unpin for Layout
impl UnsafeUnpin for Layout
impl UnwindSafe for Layout
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