pub struct WidgetState { /* private fields */ }Expand description
Generic state for all widgets in the hierarchy.
This struct contains the widget’s layout rect, flags indicating when the widget is active or focused, and other state necessary for the widget to participate in event flow.
It is provided to paint calls as a non-mutable reference,
largely so a widget can know its size, also because active
and focus state can affect the widget’s appearance. Other than
that, widgets will generally not interact with it directly,
but it is an important part of the WidgetPod struct.
Implementations§
Source§impl WidgetState
impl WidgetState
Sourcepub fn paint_rect(&self) -> Rect
pub fn paint_rect(&self) -> Rect
The paint region for this widget.
For more information, see WidgetPod::paint_rect.
Sourcepub fn layout_rect(&self) -> Rect
pub fn layout_rect(&self) -> Rect
The rectangle used when calculating layout with other widgets
Trait Implementations§
Source§impl Clone for WidgetState
impl Clone for WidgetState
Source§fn clone(&self) -> WidgetState
fn clone(&self) -> WidgetState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WidgetState
impl RefUnwindSafe for WidgetState
impl !Send for WidgetState
impl !Sync for WidgetState
impl Unpin for WidgetState
impl UnwindSafe for WidgetState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
Source§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.