pub struct ListResponse {
pub response: Response,
pub reordered: Option<(usize, usize)>,
}Expand description
Response from Context::list_reorderable.
Wraps the row-level Response (selection/hover/rect/focus) and additionally
exposes the (from, to) data indices of an item that was reordered this frame
via the keyboard. Implements Deref<Target = Response> so r.changed,
r.hovered, r.rect, etc. work directly.
§Example
let r = ui.list_reorderable(&mut list);
if let Some((from, to)) = r.reordered {
// persist the new order: item moved from `from` to `to`
let _ = (from, to);
}Available since 0.21.1.
Fields§
§response: ResponseThe row-level interaction response (selection change, hover, rect, focus).
reordered: Option<(usize, usize)>(from, to) data indices of the item moved this frame, if any.
Trait Implementations§
Source§impl Clone for ListResponse
impl Clone for ListResponse
Source§fn clone(&self) -> ListResponse
fn clone(&self) -> ListResponse
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ListResponse
impl Debug for ListResponse
Source§impl Default for ListResponse
impl Default for ListResponse
Source§fn default() -> ListResponse
fn default() -> ListResponse
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ListResponse
impl RefUnwindSafe for ListResponse
impl Send for ListResponse
impl Sync for ListResponse
impl Unpin for ListResponse
impl UnsafeUnpin for ListResponse
impl UnwindSafe for ListResponse
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