pub struct TileContext<'a, T: 'static> {
pub index: usize,
pub row: usize,
pub col: usize,
pub item: &'a T,
pub is_selected: bool,
pub is_focused: bool,
}Expand description
Context passed to the tile delegate for each realized tile.
Richer than ListView’s (index, &item, selected) — carries the 2D
grid coordinates and focus state (mirrors TableView’s CellContext).
There is intentionally no is_hovered: hover changes on every
mouse-move and is handled per-tile inside the delegate’s own widget
(its interaction signal), never by rebuilding the grid.
Fields§
§index: usizeFlat model index.
row: usizeRow in the logical grid (0-based).
col: usizeColumn in the logical grid (0-based).
item: &'a TBorrow of the item.
is_selected: boolWhether this tile is in the selection set.
is_focused: boolWhether this tile is the keyboard-focus current item. A build-time snapshot — the canonical focus indicator is the grid’s painted focus ring (it does not rebuild tiles), so a delegate reading this for custom styling accepts a one-rebuild lag.
Auto Trait Implementations§
impl<'a, T> Freeze for TileContext<'a, T>
impl<'a, T> RefUnwindSafe for TileContext<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for TileContext<'a, T>where
T: Sync,
impl<'a, T> Sync for TileContext<'a, T>where
T: Sync,
impl<'a, T> Unpin for TileContext<'a, T>
impl<'a, T> UnsafeUnpin for TileContext<'a, T>
impl<'a, T> UnwindSafe for TileContext<'a, T>where
T: RefUnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§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> ErasedDestructor for Twhere
T: 'static,
§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