[][src]Struct kas::layout::RowPositionSolver

pub struct RowPositionSolver<D: Directional> { /* fields omitted */ }

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.

Implementations

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]

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]

Call f on each child intersecting the given rect

Trait Implementations

impl<D: Clone + Directional> Clone for RowPositionSolver<D>[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

impl<D> Send for RowPositionSolver<D> where
    D: Send

impl<D> Sync for RowPositionSolver<D> where
    D: Sync

impl<D> Unpin for RowPositionSolver<D> where
    D: Unpin

impl<D> UnwindSafe for RowPositionSolver<D> where
    D: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.