pub struct TargetRegion {
pub rect: Rect,
pub role: TargetRole,
pub part: u16,
}Expand description
One interactive sub-region of a single widget node.
part is the widget’s own discriminator — an index, or a #[repr(u16)]
enum cast — so a consumer that knows the widget can tell the thumb from the
track, and one that does not can still measure both.
Fields§
§rect: RectThe region’s rectangle, in the same space as the bounds the widget was
asked about (absolute arena coordinates for a node’s own bounds).
role: TargetRoleWhat the region is for, which is what decides the floor it is audited
against: Target → target_size, Grab → grab_size, Decoration →
not audited.
part: u16Which part of the widget this is. Meaningful only to the widget that reported it.
Implementations§
Source§impl TargetRegion
impl TargetRegion
Sourcepub fn decoration(rect: Rect, part: u16) -> Self
pub fn decoration(rect: Rect, part: u16) -> Self
A region that is painted but not interactive, reported so an audit can see the whole picture without flagging it.
Trait Implementations§
Source§impl Clone for TargetRegion
impl Clone for TargetRegion
Source§fn clone(&self) -> TargetRegion
fn clone(&self) -> TargetRegion
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TargetRegion
Source§impl Debug for TargetRegion
impl Debug for TargetRegion
Source§impl PartialEq for TargetRegion
impl PartialEq for TargetRegion
impl StructuralPartialEq for TargetRegion
Auto Trait Implementations§
impl Freeze for TargetRegion
impl RefUnwindSafe for TargetRegion
impl Send for TargetRegion
impl Sync for TargetRegion
impl Unpin for TargetRegion
impl UnsafeUnpin for TargetRegion
impl UnwindSafe for TargetRegion
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