pub struct Region<ID> { /* private fields */ }Expand description
A region representing a rectangular area with an associated widget ID.
This struct is used to define the position and size of widgets within the GUI.
Implementations§
Source§impl<ID: WidgetId> Region<ID>
impl<ID: WidgetId> Region<ID>
Sourcepub const fn new(id: ID, x: i16, y: i16, w: u16, h: u16) -> Self
pub const fn new(id: ID, x: i16, y: i16, w: u16, h: u16) -> Self
Creates a new region with the specified ID and dimensions.
§Arguments
id- The widget ID for this regionx- The x-coordinate of the top-left cornery- The y-coordinate of the top-left cornerw- The width of the regionh- The height of the region
Sourcepub const fn new_with_area(id: ID, area: LwRectangle<i16, u16>) -> Self
pub const fn new_with_area(id: ID, area: LwRectangle<i16, u16>) -> Self
Creates a new region with the specified ID and area.
Sourcepub const fn zero(id: ID) -> Self
pub const fn zero(id: ID) -> Self
Creates a new region with zero dimensions at the origin.
§Arguments
id- The widget ID for this region
Sourcepub const fn replace_id(&self, id: ID) -> Self
pub const fn replace_id(&self, id: ID) -> Self
Replace the widget ID of the region.
Sourcepub fn delta_resize(&self, delta: DeltaResize) -> Region<ID>
pub fn delta_resize(&self, delta: DeltaResize) -> Region<ID>
Returns a new region resized according to the specified delta.
§Arguments
delta- The resize delta to use for resizing
Sourcepub fn resized(
&self,
width: u16,
height: u16,
anchor_point: AnchorPoint,
) -> Self
pub fn resized( &self, width: u16, height: u16, anchor_point: AnchorPoint, ) -> Self
Trait Implementations§
impl<ID: Copy> Copy for Region<ID>
impl<ID: Eq> Eq for Region<ID>
impl<ID> StructuralPartialEq for Region<ID>
Auto Trait Implementations§
impl<ID> Freeze for Region<ID>where
ID: Freeze,
impl<ID> RefUnwindSafe for Region<ID>where
ID: RefUnwindSafe,
impl<ID> Send for Region<ID>where
ID: Send,
impl<ID> Sync for Region<ID>where
ID: Sync,
impl<ID> Unpin for Region<ID>where
ID: Unpin,
impl<ID> UnsafeUnpin for Region<ID>where
ID: UnsafeUnpin,
impl<ID> UnwindSafe for Region<ID>where
ID: 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
Mutably borrows from an owned value. Read more
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.