Struct gridly::prelude::Column

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

A column component of a Location. See Component for details.

Tuple Fields§

§0: isize

Trait Implementations§

source§

impl Add<Column> for Row

Adding a component to its converse (ie, a Row to a Column) produces a Location

§

type Output = Location

The resulting type after applying the + operator.
source§

fn add(self, rhs: Column) -> Location

Performs the + operation. Read more
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<Row> for Column

Adding a component to its converse (ie, a Row to a Column) produces a Location

§

type Output = Location

The resulting type after applying the + operator.
source§

fn add(self, rhs: Row) -> Location

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 Clone for Column

source§

fn clone(&self) -> Column

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 Column

§

type Converse = Row

The converse component (Row to Column, or vice versa)
§

type Distance = Columns

The associated vector component (Rows or Columns)
source§

fn from_location<L: LocationLike>(location: L) -> Self

Get this component type from a Location. Read more
source§

fn combine(self, other: Row) -> Location

Combine this component with its converse to create a Location. Note that Row and Column can simply be added together with + to create a new Location; this method exists to assist with generic code. Read more
source§

fn name() -> &'static str

Return the lowercase name of this component type– “row” or “column”. Intended for debug printing, error messages, etc. Read more
source§

fn add_distance(self, distance: impl Into<Columns>) -> Self

Add a distance to this component. This method is provided because we can’t require a trait bound on Add for Component, but in general just using + is preferable. Read more
source§

fn distance_from(self, origin: Self) -> Columns

Find the distance between two components, using the other component as the origin Read more
source§

fn value(self) -> isize

Get the integer value of this component Read more
source§

fn distance_to(self, target: Self) -> Self::Distance

Find the distance between two components, using this component as the origin Read more
source§

fn transpose(self) -> Self::Converse

Convert a Row into a Column or vice versa Read more
source§

fn span(self, length: Self::Distance) -> ComponentRange<Self>

Create a range, starting at this component, with the given length Read more
source§

fn range_to(self, end: Self) -> ComponentRange<Self>

Create a range, starting at this component, ending at the given component Read more
source§

impl Debug for Column

source§

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

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

impl Default for Column

source§

fn default() -> Column

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

impl From<isize> for Column

source§

fn from(value: isize) -> Self

Converts to this type from the input type.
source§

impl Hash for Column

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 Ord for Column

source§

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

source§

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

source§

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

The difference between two location components is the distance between them

§

type Output = Columns

The resulting type after applying the - operator.
source§

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

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 Copy for Column

source§

impl Eq for Column

source§

impl StructuralEq for Column

source§

impl StructuralPartialEq for Column

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.