pub struct Zone64 {
pub p: Position64,
pub s: Size64,
}Expand description
A 2D zone combines a Position64 with a Size64.
Fields§
§p: Position64§s: Size64Implementations§
Source§impl Zone64
impl Zone64
Sourcepub const fn new(position: Position64, size: Size64) -> Self
pub const fn new(position: Position64, size: Size64) -> Self
Returns a new zone from the provided position and size.
Sourcepub const fn new_raw(x: i64, y: i64, width: i64, height: i64) -> Self
pub const fn new_raw(x: i64, y: i64, width: i64, height: i64) -> Self
Returns a new zone from the provided position and size raw components.
Sourcepub const fn position_size(&self) -> (Position64, Size64)
pub const fn position_size(&self) -> (Position64, Size64)
Gets a tuple with the position and size.
Sourcepub const fn position(&self) -> Position64
pub const fn position(&self) -> Position64
Get the position.
Sourcepub fn set_position(self, position: impl Into<Position64>)
pub fn set_position(self, position: impl Into<Position64>)
Chain-set the position.
Source§impl Zone64
§conversions
impl Zone64
§conversions
Sourcepub const fn as_tuple(&self) -> (i64, i64, i64, i64)
pub const fn as_tuple(&self) -> (i64, i64, i64, i64)
Returns a tuple with the (x, y, width, height) components.
Sourcepub const fn from_tuple(tup: (i64, i64, i64, i64)) -> Zone64
pub const fn from_tuple(tup: (i64, i64, i64, i64)) -> Zone64
Creates a zone from a tuple with (x, y, width, height) components.
pub const fn as_tuple_i32(&self) -> (i32, i32, i32, i32)
pub const fn from_tuple_i32(tup: (i32, i32, i32, i32)) -> Zone64
pub const fn as_tuple_u32(&self) -> (u32, u32, u32, u32)
pub const fn from_tuple_u32(tup: (u32, u32, u32, u32)) -> Zone64
pub const fn as_tuple_u16(&self) -> (u16, u16, u16, u16)
pub const fn from_tuple_u16(tup: (u16, u16, u16, u16)) -> Zone64
pub const fn as_tuple_i16(&self) -> (i16, i16, i16, i16)
pub const fn from_tuple_i16(tup: (i16, i16, i16, i16)) -> Zone64
pub const fn as_tuple_usize(&self) -> (usize, usize, usize, usize)
pub const fn from_tuple_usize(tup: (usize, usize, usize, usize)) -> Zone64
Trait Implementations§
impl Copy for Zone64
impl Eq for Zone64
impl StructuralPartialEq for Zone64
Auto Trait Implementations§
impl Freeze for Zone64
impl RefUnwindSafe for Zone64
impl Send for Zone64
impl Sync for Zone64
impl Unpin for Zone64
impl UnwindSafe for Zone64
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