[−][src]Struct kas::layout::RowPositionSolver
Allows efficient implementations of draw / event handlers based on the
layout representation.
This is only applicable where child widgets are contained in a slice of type
W: Widget (which may be Box<dyn Widget>). In other cases, the naive
implementation (test all items) must be used.
Methods
impl<D: Directional> RowPositionSolver<D>[src]
pub fn new(direction: D) -> Self[src]
Construct with given directionality
pub fn find_child<'a, W: Widget>(
self,
widgets: &'a [W],
coord: Coord
) -> Option<&'a W>[src]
self,
widgets: &'a [W],
coord: Coord
) -> Option<&'a W>
Find the child containing the given coordinates
Returns None when the coordinates lie within the margin area or
outside of the parent widget.
pub fn for_children<W: Widget, F: FnMut(&W)>(
self,
widgets: &[W],
rect: Rect,
f: F
)[src]
self,
widgets: &[W],
rect: Rect,
f: F
)
Call f on each child intersecting the given rect
Trait Implementations
impl<D: Clone + Directional> Clone for RowPositionSolver<D>[src]
fn clone(&self) -> RowPositionSolver<D>[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl<D: Copy + Directional> Copy for RowPositionSolver<D>[src]
impl<D: Debug + Directional> Debug for RowPositionSolver<D>[src]
Auto Trait Implementations
impl<D> RefUnwindSafe for RowPositionSolver<D> where
D: RefUnwindSafe,
D: RefUnwindSafe,
impl<D> Send for RowPositionSolver<D> where
D: Send,
D: Send,
impl<D> Sync for RowPositionSolver<D> where
D: Sync,
D: Sync,
impl<D> Unpin for RowPositionSolver<D> where
D: Unpin,
D: Unpin,
impl<D> UnwindSafe for RowPositionSolver<D> where
D: UnwindSafe,
D: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,