pub struct Cell {
pub x: i64,
pub y: i64,
}Fields§
§x: i64§y: i64Implementations§
Source§impl Cell
impl Cell
Sourcepub fn from_point(p: Point, cell_size: f64) -> Self
pub fn from_point(p: Point, cell_size: f64) -> Self
Get the cell that this point is inside of. Points that are perfectly on the edge between two cells will be biased towards the cell with the higher index value.
Sourcepub fn bottom_left_point(&self, cell_size: f64) -> Point
pub fn bottom_left_point(&self, cell_size: f64) -> Point
Get the point on the “bottom left” (lowest coordinate values) corner of the cell.
pub fn bottom_right_point(&self, cell_size: f64) -> Point
pub fn top_left_point(&self, cell_size: f64) -> Point
pub fn top_right_point(&self, cell_size: f64) -> Point
Sourcepub fn center_point(&self, cell_size: f64) -> Point
pub fn center_point(&self, cell_size: f64) -> Point
Get the point in the center of the cell.
Sourcepub fn shifted(&self, x: i64, y: i64) -> Self
pub fn shifted(&self, x: i64, y: i64) -> Self
Get a new cell that is the same as this one, but shifted in x and y by the given values.
pub fn in_visible_quadrant_of( &self, other_cell: &Cell, other_status: CornerStatus, ) -> bool
Trait Implementations§
Source§impl MaybeTimed for Cell
impl MaybeTimed for Cell
fn maybe_time(&self) -> Option<TimePoint>
impl Copy for Cell
impl Eq for Cell
impl StructuralPartialEq for Cell
Auto Trait Implementations§
impl Freeze for Cell
impl RefUnwindSafe for Cell
impl Send for Cell
impl Sync for Cell
impl Unpin for Cell
impl UnwindSafe for Cell
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.