pub struct RowPositionSolver<D>where
D: Directional,{ /* private fields */ }Expand description
Allows efficient implementations of draw / event handlers based on the
layout representation.
This is only applicable where child widgets are contained in a Collection.
Implementations§
Source§impl<D> RowPositionSolver<D>where
D: Directional,
impl<D> RowPositionSolver<D>where
D: Directional,
Sourcepub fn new(direction: D) -> RowPositionSolver<D>
pub fn new(direction: D) -> RowPositionSolver<D>
Construct with given directionality
Sourcepub fn find_child_index<C>(self, widgets: &C, coord: Coord) -> Option<usize>where
C: Collection + ?Sized,
pub fn find_child_index<C>(self, widgets: &C, coord: Coord) -> Option<usize>where
C: Collection + ?Sized,
Find the child containing the given coordinates
Returns None when the coordinates lie within the margin area or
outside of the parent widget.
Also returns None if Collection::get_tile returns None for
some index less than len (a theoretical but unexpected error case).
Sourcepub fn find_child<C>(self, widgets: &C, coord: Coord) -> Option<&dyn Tile>where
C: Collection + ?Sized,
pub fn find_child<C>(self, widgets: &C, coord: Coord) -> Option<&dyn Tile>where
C: Collection + ?Sized,
Find the child containing the given coordinates
Returns None when the coordinates lie within the margin area or
outside of the parent widget.
Also returns None if Collection::get_tile returns None for
some index less than len (a theoretical but unexpected error case).
Sourcepub fn find_child_mut<C>(
self,
widgets: &mut C,
coord: Coord,
) -> Option<&mut dyn Tile>where
C: Collection + ?Sized,
pub fn find_child_mut<C>(
self,
widgets: &mut C,
coord: Coord,
) -> Option<&mut dyn Tile>where
C: Collection + ?Sized,
Find the child containing the given coordinates
Returns None when the coordinates lie within the margin area or
outside of the parent widget.
Also returns None if Collection::get_tile returns None for
some index less than len (a theoretical but unexpected error case).
Sourcepub fn for_children<C, F>(self, widgets: &C, rect: Rect, f: F)
pub fn for_children<C, F>(self, widgets: &C, rect: Rect, f: F)
Call f on each child intersecting the given rect
Trait Implementations§
Source§impl<D> Clone for RowPositionSolver<D>where
D: Clone + Directional,
impl<D> Clone for RowPositionSolver<D>where
D: Clone + Directional,
Source§fn clone(&self) -> RowPositionSolver<D>
fn clone(&self) -> RowPositionSolver<D>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<D> Debug for RowPositionSolver<D>where
D: Debug + Directional,
impl<D> Debug for RowPositionSolver<D>where
D: Debug + Directional,
impl<D> Copy for RowPositionSolver<D>where
D: Copy + Directional,
Auto Trait Implementations§
impl<D> Freeze for RowPositionSolver<D>where
D: Freeze,
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§
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
Source§impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
Source§fn try_cast_approx(self) -> Result<T, Error>
fn try_cast_approx(self) -> Result<T, Error>
Source§fn cast_approx(self) -> T
fn cast_approx(self) -> T
Source§impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
Source§fn cast_trunc(self) -> T
fn cast_trunc(self) -> T
Source§fn cast_nearest(self) -> T
fn cast_nearest(self) -> T
Source§fn cast_floor(self) -> T
fn cast_floor(self) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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