Struct gridly::prelude::Rows

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

A rows component of a Vector

Tuple Fields§

§0: isize

Trait Implementations§

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 Add<Rows> for Row

§

type Output = Row

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

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

§

type Output = Rows

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl AddAssign<Rows> for Row

source§

fn add_assign(&mut self, rhs: Rows)

Performs the += operation. Read more
source§

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

source§

fn add_assign(&mut self, rhs: T)

Performs the += operation. Read more
source§

impl Clone for Rows

source§

fn clone(&self) -> Rows

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 Rows

§

type Converse = Columns

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

type Point = Row

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: Columns) -> 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 Rows

source§

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

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

impl Default for Rows

source§

fn default() -> Rows

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

impl From<isize> for Rows

source§

fn from(value: isize) -> Self

Converts to this type from the input type.
source§

impl Hash for Rows

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

§

type Output = Rows

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 Rows
where isize: MulAssign<T>,

source§

fn mul_assign(&mut self, factor: T)

Performs the *= operation. Read more
source§

impl Neg for Rows

§

type Output = Rows

The resulting type after applying the - operator.
source§

fn neg(self) -> Self

Performs the unary - operation. Read more
source§

impl Ord for Rows

source§

fn cmp(&self, other: &Rows) -> 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 Rows

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 Rows

source§

fn eq(&self, other: &Rows) -> 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 Rows

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 Rows

source§

fn partial_cmp(&self, other: &Rows) -> 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<Rows> for Row

§

type Output = Row

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

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

§

type Output = Rows

The resulting type after applying the - operator.
source§

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

Performs the - operation. Read more
source§

impl SubAssign<Rows> for Row

source§

fn sub_assign(&mut self, rhs: Rows)

Performs the -= operation. Read more
source§

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

source§

fn sub_assign(&mut self, rhs: T)

Performs the -= operation. Read more
source§

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

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 Rows

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 Rows

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

source§

fn rows(&self) -> Rows

source§

fn columns(&self) -> Columns

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 Rows

source§

impl Eq for Rows

source§

impl StructuralEq for Rows

source§

impl StructuralPartialEq for Rows

Auto Trait Implementations§

§

impl RefUnwindSafe for Rows

§

impl Send for Rows

§

impl Sync for Rows

§

impl Unpin for Rows

§

impl UnwindSafe for Rows

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.