Skip to main content

Layout

Struct Layout 

Source
pub struct Layout { /* private fields */ }

Implementations§

Source§

impl Layout

Source

pub fn new(heights: Heights, overscan: usize) -> Self

Source

pub fn heights(&self) -> &Heights

Source

pub fn heights_mut(&mut self) -> &mut Heights

Source

pub fn window(&self, offset: f64, viewport: f64) -> Result<Window, Error>

Source

pub fn anchor(&self, offset: f64) -> Result<Option<Anchor>, Error>

Source

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.

Source

pub fn measure( &mut self, index: usize, height: f64, anchor: Option<Anchor>, ) -> Result<(bool, Option<f64>), Error>

Source

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§

Source§

impl Debug for Layout

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Forget for Layout

§

impl Freeze for Layout

§

impl Move for Layout

§

impl RefUnwindSafe for Layout

§

impl Send for Layout
where RawVecInner: Send, RawTable<(usize, f64)>: Send, RawTable<(usize, Deviation)>: Send,

§

impl Sync for Layout
where RawVecInner: Sync, RawTable<(usize, f64)>: Sync, RawTable<(usize, Deviation)>: Sync,

§

impl Unpin for Layout
where *const u8 is !null: Unpin,

§

impl UnsafeUnpin for Layout

§

impl UnwindSafe for Layout
where RawVecInner: UnwindSafe, HashMap<usize, f64>: UnwindSafe, HashMap<usize, Deviation>: 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.