Struct bracket_terminal::prelude::Point
source · [−]Expand description
Helper struct defining a 2D point in space.
Fields
x: i32
The point’s X location
y: i32
The point’s Y location
Implementations
sourceimpl Point
impl Point
sourcepub fn new<T>(x: T, y: T) -> Pointwhere
T: TryInto<i32>,
pub fn new<T>(x: T, y: T) -> Pointwhere
T: TryInto<i32>,
Create a new point from an x/y coordinate.
sourcepub const fn constant(x: i32, y: i32) -> Point
pub const fn constant(x: i32, y: i32) -> Point
Create a new point from i32, this can be constant
sourcepub fn from_tuple<T>(t: (T, T)) -> Pointwhere
T: TryInto<i32>,
pub fn from_tuple<T>(t: (T, T)) -> Pointwhere
T: TryInto<i32>,
Create a point from a tuple of two i32s
sourcepub fn to_index<T>(self, width: T) -> usizewhere
T: TryInto<usize>,
pub fn to_index<T>(self, width: T) -> usizewhere
T: TryInto<usize>,
Helper for map index conversion
sourcepub fn to_unsigned_tuple(self) -> (usize, usize)
pub fn to_unsigned_tuple(self) -> (usize, usize)
Trait Implementations
sourceimpl Add<Point> for Point
impl Add<Point> for Point
Overloads: We support basic point math Support adding a point to a point
sourceimpl AddAssign<Point> for Point
impl AddAssign<Point> for Point
sourcefn add_assign(&mut self, other: Point)
fn add_assign(&mut self, other: Point)
Performs the
+=
operation. Read moresourceimpl DivAssign<Point> for Point
impl DivAssign<Point> for Point
sourcefn div_assign(&mut self, other: Point)
fn div_assign(&mut self, other: Point)
Performs the
/=
operation. Read moresourceimpl MulAssign<Point> for Point
impl MulAssign<Point> for Point
sourcefn mul_assign(&mut self, other: Point)
fn mul_assign(&mut self, other: Point)
Performs the
*=
operation. Read moresourceimpl SubAssign<Point> for Point
impl SubAssign<Point> for Point
sourcefn sub_assign(&mut self, other: Point)
fn sub_assign(&mut self, other: Point)
Performs the
-=
operation. Read moreimpl Copy for Point
impl Eq for Point
impl StructuralEq for Point
impl StructuralPartialEq for Point
Auto Trait Implementations
impl RefUnwindSafe for Point
impl Send for Point
impl Sync for Point
impl Unpin for Point
impl UnwindSafe for Point
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more