pub struct RowPositionSolver<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: Directional> RowPositionSolver<D>
impl<D: Directional> RowPositionSolver<D>
Sourcepub fn find_child_index<C: Collection + ?Sized>(
self,
widgets: &C,
coord: Coord,
) -> Option<usize>
pub fn find_child_index<C: Collection + ?Sized>( self, widgets: &C, coord: Coord, ) -> Option<usize>
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_layout
returns None
for
some index less than len
(a theoretical but unexpected error case).
Sourcepub fn find_child<C: Collection + ?Sized>(
self,
widgets: &C,
coord: Coord,
) -> Option<&dyn Layout>
pub fn find_child<C: Collection + ?Sized>( self, widgets: &C, coord: Coord, ) -> Option<&dyn Layout>
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_layout
returns None
for
some index less than len
(a theoretical but unexpected error case).
Sourcepub fn find_child_mut<C: Collection + ?Sized>(
self,
widgets: &mut C,
coord: Coord,
) -> Option<&mut dyn Layout>
pub fn find_child_mut<C: Collection + ?Sized>( self, widgets: &mut C, coord: Coord, ) -> Option<&mut dyn Layout>
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_layout
returns None
for
some index less than len
(a theoretical but unexpected error case).
Sourcepub fn for_children_mut<C: Collection + ?Sized, F: FnMut(&mut dyn Layout)>(
self,
widgets: &mut C,
rect: Rect,
f: F,
)
pub fn for_children_mut<C: Collection + ?Sized, F: FnMut(&mut dyn Layout)>( self, widgets: &mut C, rect: Rect, f: F, )
Call f
on each child intersecting the given rect
Trait Implementations§
Source§impl<D: Clone + Directional> Clone for RowPositionSolver<D>
impl<D: Clone + Directional> Clone for RowPositionSolver<D>
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 + Directional> Debug for RowPositionSolver<D>
impl<D: Debug + Directional> Debug for RowPositionSolver<D>
impl<D: Copy + Directional> Copy for RowPositionSolver<D>
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