Cell

Struct Cell 

Source
pub struct Cell {
    pub x: i64,
    pub y: i64,
}

Fields§

§x: i64§y: i64

Implementations§

Source§

impl Cell

Source

pub fn new(x: i64, y: i64) -> Self

Make a new cell from a pair of indices.

Source

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.

Source

pub fn bottom_left_point(&self, cell_size: f64) -> Point

Get the point on the “bottom left” (lowest coordinate values) corner of the cell.

Source

pub fn bottom_right_point(&self, cell_size: f64) -> Point

Source

pub fn top_left_point(&self, cell_size: f64) -> Point

Source

pub fn top_right_point(&self, cell_size: f64) -> Point

Source

pub fn center_point(&self, cell_size: f64) -> Point

Get the point in the center of the cell.

Source

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.

Source

pub fn in_visible_quadrant_of( &self, other_cell: &Cell, other_status: CornerStatus, ) -> bool

Trait Implementations§

Source§

impl Clone for Cell

Source§

fn clone(&self) -> Cell

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Cell

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Edge<Cell, ()> for (Cell, Cell)

Source§

fn from_vertex(&self) -> &Cell

Source§

fn to_vertex(&self) -> &Cell

Source§

fn attributes(&self) -> &()

Source§

impl From<[i64; 2]> for Cell

Source§

fn from(value: [i64; 2]) -> Self

Converts to this type from the input type.
Source§

impl From<(i64, i64)> for Cell

Source§

fn from((x, y): (i64, i64)) -> Self

Converts to this type from the input type.
Source§

impl From<Cell> for [i64; 2]

Source§

fn from(value: Cell) -> Self

Converts to this type from the input type.
Source§

impl From<Cell> for (i64, i64)

Source§

fn from(value: Cell) -> Self

Converts to this type from the input type.
Source§

impl Hash for Cell

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl MaybeTimed for Cell

Source§

impl PartialEq for Cell

Source§

fn eq(&self, other: &Cell) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Sub for Cell

Source§

type Output = (i64, i64)

The resulting type after applying the - operator.
Source§

fn sub(self, other: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl Copy for Cell

Source§

impl Eq for Cell

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Keyed for T
where T: Key + Clone,

Source§

type Key = T

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SelfKey for T
where T: Key + Clone,

Source§

type KeyRef<'a> = &'a <T as Keyed>::Key where T: 'a

Source§

fn key<'a>(&'a self) -> &'a <T as Keyed>::Key
where T: 'a,

Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Key for T
where T: Hash + Eq + Send + Sync + Debug + 'static,

Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,