Struct gridly::prelude::Columns

source ·
#[repr(transparent)]
pub struct Columns(pub isize);
Expand description

A columns component of a Vector

Tuple Fields§

§0: isize

Trait Implementations§

source§

impl Add<Columns> for Column

§

type Output = Column

The resulting type after applying the + operator.
source§

fn add(self, rhs: Columns) -> Self

Performs the + operation. Read more
source§

impl Add<Columns> for Rows

Adding a Rows to a Columns produces a Vector

§

type Output = Vector

The resulting type after applying the + operator.
source§

fn add(self, rhs: Columns) -> Vector

Performs the + operation. Read more
source§

impl Add<Rows> for Columns

Adding a Rows to a Columns produces a Vector

§

type Output = Vector

The resulting type after applying the + operator.
source§

fn add(self, rhs: Rows) -> Vector

Performs the + operation. Read more
source§

impl<T: Into<Columns>> Add<T> for Columns

§

type Output = Columns

The resulting type after applying the + operator.
source§

fn add(self, rhs: T) -> Self

Performs the + operation. Read more
source§

impl AddAssign<Columns> for Column

source§

fn add_assign(&mut self, rhs: Columns)

Performs the += operation. Read more
source§

impl<T: Into<Columns>> AddAssign<T> for Columns

source§

fn add_assign(&mut self, rhs: T)

Performs the += operation. Read more
source§

impl Clone for Columns

source§

fn clone(&self) -> Columns

Returns a copy 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 Component for Columns

§

type Converse = Rows

The converse component (Rows to Columns or vice versa)
§

type Point = Column

The assoicated location component type (Row or Column)
source§

fn from_vector(vector: impl VectorLike) -> Self

Get this compnent from a Vector Read more
source§

fn combine(self, other: Rows) -> Vector

Create a vector from a Row and Column Read more
source§

fn value(self) -> isize

Get the integer value of this component. Read more
source§

fn transpose(self) -> Self::Converse

source§

impl Debug for Columns

source§

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

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

impl Default for Columns

source§

fn default() -> Columns

Returns the “default value” for a type. Read more
source§

impl From<isize> for Columns

source§

fn from(value: isize) -> Self

Converts to this type from the input type.
source§

impl Hash for Columns

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<T> Mul<T> for Columns
where isize: Mul<T, Output = isize>,

§

type Output = Columns

The resulting type after applying the * operator.
source§

fn mul(self, factor: T) -> Self

Performs the * operation. Read more
source§

impl<T> MulAssign<T> for Columns
where isize: MulAssign<T>,

source§

fn mul_assign(&mut self, factor: T)

Performs the *= operation. Read more
source§

impl Neg for Columns

§

type Output = Columns

The resulting type after applying the - operator.
source§

fn neg(self) -> Self

Performs the unary - operation. Read more
source§

impl Ord for Columns

source§

fn cmp(&self, other: &Columns) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<isize> for Columns

source§

fn eq(&self, rhs: &isize) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq for Columns

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<isize> for Columns

source§

fn partial_cmp(&self, rhs: &isize) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, rhs: &isize) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, rhs: &isize) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn ge(&self, rhs: &isize) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

fn gt(&self, rhs: &isize) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

impl PartialOrd for Columns

source§

fn partial_cmp(&self, other: &Columns) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Sub<Columns> for Column

§

type Output = Column

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Columns) -> Self

Performs the - operation. Read more
source§

impl<T: Into<Columns>> Sub<T> for Columns

§

type Output = Columns

The resulting type after applying the - operator.
source§

fn sub(self, rhs: T) -> Self

Performs the - operation. Read more
source§

impl SubAssign<Columns> for Column

source§

fn sub_assign(&mut self, rhs: Columns)

Performs the -= operation. Read more
source§

impl<T: Into<Columns>> SubAssign<T> for Columns

source§

fn sub_assign(&mut self, rhs: T)

Performs the -= operation. Read more
source§

impl<'a> Sum<&'a Columns> for Columns

source§

fn sum<I: Iterator<Item = &'a Self>>(iter: I) -> Self

Method which takes an iterator and generates Self from the elements by “summing up” the items.
source§

impl Sum for Columns

source§

fn sum<I: Iterator<Item = Self>>(iter: I) -> Self

Method which takes an iterator and generates Self from the elements by “summing up” the items.
source§

impl VectorLike for Columns

A Rows or a Columns value can be treated as a Vector where the converse component is 0.

source§

fn columns(&self) -> Columns

source§

fn rows(&self) -> Rows

source§

fn as_vector(&self) -> Vector

source§

fn manhattan_length(&self) -> isize

Return the manhattan length of the vector. The manhattan length of a vector is the sum of the absolute values of its components. Read more
source§

fn checked_manhattan_length(&self) -> Option<isize>

Return the manhattan length of the vector, or None if there are any overflows. Read more
source§

fn clockwise(&self) -> Vector

Return a new vector, rotated 90 degrees clockwise. Read more
source§

fn anticlockwise(&self) -> Vector

Return a new vector, rotated 90 degrees counterclockwise. Read more
source§

fn reverse(&self) -> Vector

Return a new vector, facing the opposite direction of this one Read more
source§

fn rotate(&self, rotation: Rotation) -> Vector

Return a new vector, rotated by a given rotation Read more
source§

fn get_component<T: Component>(&self) -> T

Generically get either the Rows or Columns of a vector Read more
source§

fn transpose(&self) -> Vector

Swap the rows and columns of this Vector Read more
source§

fn direction(&self) -> Option<Direction>

If the vector is pointing in an orthogonal direction, return that direction Read more
source§

impl Copy for Columns

source§

impl Eq for Columns

source§

impl StructuralEq for Columns

source§

impl StructuralPartialEq for Columns

Auto Trait Implementations§

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.