Struct alacritty_terminal::index::Point

source ·
pub struct Point<L = Line, C = Column> {
    pub line: L,
    pub column: C,
}
Expand description

Index in the grid using row, column notation.

Fields§

§line: L§column: C

Implementations§

source§

impl<L, C> Point<L, C>

source

pub fn new(line: L, column: C) -> Point<L, C>

source§

impl Point

source

pub fn sub<D>(self, dimensions: &D, boundary: Boundary, rhs: usize) -> Self
where D: Dimensions,

Subtract a number of columns from a point.

source

pub fn add<D>(self, dimensions: &D, boundary: Boundary, rhs: usize) -> Self
where D: Dimensions,

Add a number of columns to a point.

source

pub fn grid_clamp<D>(self, dimensions: &D, boundary: Boundary) -> Self
where D: Dimensions,

Clamp a point to a grid boundary.

Trait Implementations§

source§

impl<L: Clone, C: Clone> Clone for Point<L, C>

source§

fn clone(&self) -> Point<L, C>

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<L: Debug, C: Debug> Debug for Point<L, C>

source§

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

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

impl<L: Default, C: Default> Default for Point<L, C>

source§

fn default() -> Point<L, C>

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

impl<'de, L, C> Deserialize<'de> for Point<L, C>
where L: Deserialize<'de>, C: Deserialize<'de>,

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<T> Index<Point> for Grid<T>

§

type Output = T

The returned type after indexing.
source§

fn index(&self, point: Point) -> &T

Performs the indexing (container[index]) operation. Read more
source§

impl<T> IndexMut<Point> for Grid<T>

source§

fn index_mut(&mut self, point: Point) -> &mut T

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<L: Ord, C: Ord> Ord for Point<L, C>

source§

fn cmp(&self, other: &Point<L, C>) -> 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<L: PartialEq, C: PartialEq> PartialEq for Point<L, C>

source§

fn eq(&self, other: &Point<L, C>) -> 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<L: Ord, C: Ord> PartialOrd for Point<L, C>

source§

fn partial_cmp(&self, other: &Point<L, C>) -> 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<L, C> Serialize for Point<L, C>
where L: Serialize, C: Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<L: Copy, C: Copy> Copy for Point<L, C>

source§

impl<L: Eq, C: Eq> Eq for Point<L, C>

source§

impl<L, C> StructuralPartialEq for Point<L, C>

Auto Trait Implementations§

§

impl<L, C> Freeze for Point<L, C>
where L: Freeze, C: Freeze,

§

impl<L, C> RefUnwindSafe for Point<L, C>

§

impl<L, C> Send for Point<L, C>
where L: Send, C: Send,

§

impl<L, C> Sync for Point<L, C>
where L: Sync, C: Sync,

§

impl<L, C> Unpin for Point<L, C>
where L: Unpin, C: Unpin,

§

impl<L, C> UnwindSafe for Point<L, C>
where L: UnwindSafe, C: UnwindSafe,

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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ResetDiscriminant<T> for T
where T: Copy,

source§

fn discriminant(&self) -> T

Value based on which equality for the reset will be determined.
source§

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

§

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

§

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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,