Skip to main content

ItemsCursor

Struct ItemsCursor 

Source
pub struct ItemsCursor<'a, T> { /* private fields */ }
Expand description

An update of an ItemsHost in progress.

Implementations§

Source§

impl<'a, T> ItemsCursor<'a, T>

Source

pub fn next( &mut self, key: u64, selected: bool, build: impl FnOnce() -> (T, Widget), ) -> Option<Item<'_, T>>

The next item, keyed key (see crate::screens::bind::key); build makes a new instance. None when it’s outside the visible window (virtualized lists) — skip its bindings.

Source

pub fn finish( self, empty: Option<fn() -> Widget>, ) -> Option<(&'a mut Widget, &'a mut Update)>

Ends the update. With empty (the .Empty template’s builder) and no items, shows that widget and returns it for its bindings.

Auto Trait Implementations§

§

impl<'a, T> !UnwindSafe for ItemsCursor<'a, T>

§

impl<'a, T> Freeze for ItemsCursor<'a, T>
where &'a mut Vec<(u64, T)>: Freeze, HashMap<u64, (T, Widget)>: Freeze,

§

impl<'a, T> RefUnwindSafe for ItemsCursor<'a, T>
where &'a mut Vec<(u64, T)>: RefUnwindSafe, HashMap<u64, (T, Widget)>: RefUnwindSafe,

§

impl<'a, T> Send for ItemsCursor<'a, T>
where &'a mut Vec<(u64, T)>: Send, HashMap<u64, (T, Widget)>: Send,

§

impl<'a, T> Sync for ItemsCursor<'a, T>
where &'a mut Vec<(u64, T)>: Sync, HashMap<u64, (T, Widget)>: Sync,

§

impl<'a, T> Unpin for ItemsCursor<'a, T>
where &'a mut Vec<(u64, T)>: Unpin, HashMap<u64, (T, Widget)>: Unpin,

§

impl<'a, T> UnsafeUnpin for ItemsCursor<'a, T>
where &'a mut Vec<(u64, T)>: UnsafeUnpin, HashMap<u64, (T, Widget)>: UnsafeUnpin,

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> Arg<T> for T

Source§

fn arg(self) -> T

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.