Expand description
Tuple Fields
0: i321: i32Implementations
sourceimpl Offset
impl Offset
sourcepub fn clamp(self, min: Self, max: Self) -> Self
pub fn clamp(self, min: Self, max: Self) -> Self
Restrict a value to the specified interval, componentwise
sourcepub fn distance_l1(self) -> i32
pub fn distance_l1(self) -> i32
Return the L1 (rectilinear / taxicab) distance
sourcepub fn distance_l_inf(self) -> i32
pub fn distance_l_inf(self) -> i32
Return the L-inf (max) distance
sourcepub fn extract<D: Directional>(self, dir: D) -> i32
pub fn extract<D: Directional>(self, dir: D) -> i32
Extract one component, based on a direction
This merely extracts the horizontal or vertical component. It never negates it, even if the axis is reversed.
sourcepub fn set_component<D: Directional>(&mut self, dir: D, value: i32)
pub fn set_component<D: Directional>(&mut self, dir: D, value: i32)
Set one component of self, based on a direction
This does not negate components when the direction is reversed.
Trait Implementations
sourceimpl AddAssign<Offset> for Coord
impl AddAssign<Offset> for Coord
sourcefn add_assign(&mut self, rhs: Offset)
fn add_assign(&mut self, rhs: Offset)
Performs the += operation. Read more
sourceimpl AddAssign<Offset> for Event
impl AddAssign<Offset> for Event
sourcefn add_assign(&mut self, offset: Offset)
fn add_assign(&mut self, offset: Offset)
Performs the += operation. Read more
sourceimpl AddAssign<Offset> for Offset
impl AddAssign<Offset> for Offset
sourcefn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the += operation. Read more
sourceimpl AddAssign<Offset> for Rect
impl AddAssign<Offset> for Rect
sourcefn add_assign(&mut self, offset: Offset)
fn add_assign(&mut self, offset: Offset)
Performs the += operation. Read more
sourceimpl ConvApprox<DVec2> for Offset
impl ConvApprox<DVec2> for Offset
sourcefn try_conv_approx(arg: DVec2) -> Result<Self>
fn try_conv_approx(arg: DVec2) -> Result<Self>
Try converting from T to Self, allowing approximation of value Read more
sourcefn conv_approx(x: T) -> Self
fn conv_approx(x: T) -> Self
Converting from T to Self, allowing approximation of value Read more
sourceimpl ConvApprox<Vec2> for Offset
impl ConvApprox<Vec2> for Offset
sourcefn try_conv_approx(arg: Vec2) -> Result<Self>
fn try_conv_approx(arg: Vec2) -> Result<Self>
Try converting from T to Self, allowing approximation of value Read more
sourcefn conv_approx(x: T) -> Self
fn conv_approx(x: T) -> Self
Converting from T to Self, allowing approximation of value Read more
sourceimpl ConvFloat<DVec2> for Offset
impl ConvFloat<DVec2> for Offset
sourcefn try_conv_trunc(x: DVec2) -> Result<Self>
fn try_conv_trunc(x: DVec2) -> Result<Self>
Try converting to integer with truncation Read more
sourcefn try_conv_nearest(x: DVec2) -> Result<Self>
fn try_conv_nearest(x: DVec2) -> Result<Self>
Try converting to the nearest integer Read more
sourcefn try_conv_floor(x: DVec2) -> Result<Self>
fn try_conv_floor(x: DVec2) -> Result<Self>
Try converting the floor to an integer Read more
sourcefn try_conv_ceil(x: DVec2) -> Result<Self>
fn try_conv_ceil(x: DVec2) -> Result<Self>
Try convert the ceiling to an integer Read more
sourcefn conv_trunc(x: T) -> Self
fn conv_trunc(x: T) -> Self
Convert to integer with truncatation Read more
sourcefn conv_nearest(x: T) -> Self
fn conv_nearest(x: T) -> Self
Convert to the nearest integer Read more
sourcefn conv_floor(x: T) -> Self
fn conv_floor(x: T) -> Self
Convert the floor to an integer Read more
sourceimpl ConvFloat<Vec2> for Offset
impl ConvFloat<Vec2> for Offset
sourcefn try_conv_trunc(x: Vec2) -> Result<Self>
fn try_conv_trunc(x: Vec2) -> Result<Self>
Try converting to integer with truncation Read more
sourcefn try_conv_nearest(x: Vec2) -> Result<Self>
fn try_conv_nearest(x: Vec2) -> Result<Self>
Try converting to the nearest integer Read more
sourcefn try_conv_floor(x: Vec2) -> Result<Self>
fn try_conv_floor(x: Vec2) -> Result<Self>
Try converting the floor to an integer Read more
sourcefn try_conv_ceil(x: Vec2) -> Result<Self>
fn try_conv_ceil(x: Vec2) -> Result<Self>
Try convert the ceiling to an integer Read more
sourcefn conv_trunc(x: T) -> Self
fn conv_trunc(x: T) -> Self
Convert to integer with truncatation Read more
sourcefn conv_nearest(x: T) -> Self
fn conv_nearest(x: T) -> Self
Convert to the nearest integer Read more
sourcefn conv_floor(x: T) -> Self
fn conv_floor(x: T) -> Self
Convert the floor to an integer Read more
sourceimpl<'de> Deserialize<'de> for Offset
impl<'de> Deserialize<'de> for Offset
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl PartialEq<Offset> for Offset
impl PartialEq<Offset> for Offset
sourceimpl SubAssign<Offset> for Coord
impl SubAssign<Offset> for Coord
sourcefn sub_assign(&mut self, rhs: Offset)
fn sub_assign(&mut self, rhs: Offset)
Performs the -= operation. Read more
sourceimpl SubAssign<Offset> for Offset
impl SubAssign<Offset> for Offset
sourcefn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the -= operation. Read more
sourceimpl SubAssign<Offset> for Rect
impl SubAssign<Offset> for Rect
sourcefn sub_assign(&mut self, offset: Offset)
fn sub_assign(&mut self, offset: Offset)
Performs the -= operation. Read more
impl Copy for Offset
impl Eq for Offset
impl StructuralEq for Offset
impl StructuralPartialEq for Offset
Auto Trait Implementations
impl RefUnwindSafe for Offset
impl Send for Offset
impl Sync for Offset
impl Unpin for Offset
impl UnwindSafe for Offset
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
sourcefn try_cast_approx(self) -> Result<T, Error>
fn try_cast_approx(self) -> Result<T, Error>
Try approximate conversion from Self to T Read more
sourcefn cast_approx(self) -> T
fn cast_approx(self) -> T
Cast approximately from Self to T Read more
sourceimpl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
sourcefn cast_trunc(self) -> T
fn cast_trunc(self) -> T
Cast to integer, truncating Read more
sourcefn cast_nearest(self) -> T
fn cast_nearest(self) -> T
Cast to the nearest integer Read more
sourcefn cast_floor(self) -> T
fn cast_floor(self) -> T
Cast the floor to an integer Read more
sourcefn try_cast_trunc(self) -> Result<T, Error>
fn try_cast_trunc(self) -> Result<T, Error>
Try converting to integer with truncation Read more
sourcefn try_cast_nearest(self) -> Result<T, Error>
fn try_cast_nearest(self) -> Result<T, Error>
Try converting to the nearest integer Read more
sourcefn try_cast_floor(self) -> Result<T, Error>
fn try_cast_floor(self) -> Result<T, Error>
Try converting the floor to an integer Read more
sourcefn try_cast_ceil(self) -> Result<T, Error>
fn try_cast_ceil(self) -> Result<T, Error>
Try convert the ceiling to an integer Read more
sourceimpl<S, T> ConvApprox<S> for Twhere
T: Conv<S>,
impl<S, T> ConvApprox<S> for Twhere
T: Conv<S>,
sourcefn try_conv_approx(x: S) -> Result<T, Error>
fn try_conv_approx(x: S) -> Result<T, Error>
Try converting from T to Self, allowing approximation of value Read more
sourcefn conv_approx(x: S) -> T
fn conv_approx(x: S) -> T
Converting from T to Self, allowing approximation of value Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key and return true if they are equal.