pub struct UCoord(/* private fields */);Implementations§
Source§impl UCoord
impl UCoord
Sourcepub fn new(width: u32, height: u32) -> UCoord
pub fn new(width: u32, height: u32) -> UCoord
Creates a new UCoord.
Panics if width or height is greater than ::core::i32::MAX.
Sourcepub const fn new_u16(width: u16, height: u16) -> UCoord
pub const fn new_u16(width: u16, height: u16) -> UCoord
Like new, but const and never panics as it’s impossible to construct an invalid ucoord
pub fn from_icoord(icoord: ICoord) -> UCoord
pub const fn to_icoord(self) -> ICoord
pub const fn get(self, axis: Axis) -> u32
pub fn with_axis<F>(self, axis: Axis, f: F) -> UCoord
pub fn set(self, axis: Axis, value: u32) -> UCoord
pub fn set_in_place(&mut self, axis: Axis, value: u32)
pub fn new_axis(this_axis: u32, other_axis: u32, axis: Axis) -> UCoord
pub fn get_static<A>(self) -> u32where
A: StaticAxis,
pub fn with_static_axis<A, F>(self, f: F) -> UCoord
pub fn set_static<A>(self, value: u32) -> UCoordwhere
A: StaticAxis,
pub fn set_static_in_place<A>(&mut self, value: u32)where
A: StaticAxis,
pub fn new_static_axis<A>(this_axis: u32, other_axis: u32) -> UCoordwhere
A: StaticAxis,
pub fn set_width(self, width: u32) -> UCoord
pub fn set_height(self, height: u32) -> UCoord
pub fn set_width_in_place(&mut self, width: u32)
pub fn set_height_in_place(&mut self, height: u32)
pub fn checked_sub(self, rhs: UCoord) -> Option<UCoord>
pub fn saturating_sub(self, rhs: UCoord) -> UCoord
pub const fn max_field() -> u32
pub const fn max() -> UCoord
pub const fn is_zero(self) -> bool
pub const fn is_valid(self, icoord: ICoord) -> bool
pub const fn constrain(self, icoord: ICoord) -> Option<ICoord>
pub const fn icoord_iter_row_major(self) -> ICoordIterRowMajor ⓘ
pub fn pairwise_max(self, other: UCoord) -> UCoord
pub fn pairwise_min(self, other: UCoord) -> UCoord
pub const fn transpose(self) -> UCoord
pub const fn is_empty(self) -> bool
pub const fn is_on_edge(self, _: ICoord) -> bool
pub fn edge_iter(self) -> Iter ⓘ
Trait Implementations§
Source§impl<T> DivAssign<T> for UCoord
impl<T> DivAssign<T> for UCoord
Source§fn div_assign(&mut self, rhs: T)
fn div_assign(&mut self, rhs: T)
Performs the
/= operation. Read moreSource§impl<T> MulAssign<T> for UCoord
impl<T> MulAssign<T> for UCoord
Source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
Performs the
*= operation. Read moreSource§impl Ord for UCoord
impl Ord for UCoord
Source§impl PartialOrd for UCoord
impl PartialOrd for UCoord
impl Copy for UCoord
impl Eq for UCoord
impl StructuralPartialEq for UCoord
Auto Trait Implementations§
impl Freeze for UCoord
impl RefUnwindSafe for UCoord
impl Send for UCoord
impl Sync for UCoord
impl Unpin for UCoord
impl UnwindSafe for UCoord
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