Struct pixels_graphics_lib::math::URect
source · [−]Fields
x1: usize
y1: usize
x2: usize
y2: usize
Implementations
sourceimpl URect
impl URect
pub const fn width(&self) -> usize
pub const fn height(&self) -> usize
pub fn move_to(&self, x: usize, y: usize) -> URect
pub fn translate(&self, x: isize, y: isize) -> Result<URect, String>
pub fn topleft(&self) -> UPoint
pub fn bottomright(&self) -> UPoint
sourcepub fn union(&self, other: &URect) -> URect
pub fn union(&self, other: &URect) -> URect
Union this rect and another, the result will contain both rectangles Generally, this means the result will be bigger than self
sourcepub fn intersect(&self, other: &URect) -> URect
pub fn intersect(&self, other: &URect) -> URect
Intersect this rect and another, the result will contain the area covered by both rectangles Generally, this means the result will be smaller than self
Returns
self if rectangles do not intersect
pub fn intersects(&self, other: &URect) -> bool
Trait Implementations
sourceimpl<'de> Deserialize<'de> for URect
impl<'de> Deserialize<'de> for URect
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 Ord for URect
impl Ord for URect
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<URect> for URect
impl PartialEq<URect> for URect
sourceimpl PartialOrd<URect> for URect
impl PartialOrd<URect> for URect
sourcefn partial_cmp(&self, other: &URect) -> Option<Ordering>
fn partial_cmp(&self, other: &URect) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
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 · sourcefn le(&self, other: &Rhs) -> bool
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
impl Copy for URect
impl Eq for URect
impl StructuralEq for URect
impl StructuralPartialEq for URect
Auto Trait Implementations
impl RefUnwindSafe for URect
impl Send for URect
impl Sync for URect
impl Unpin for URect
impl UnwindSafe for URect
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
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.
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<R, P> ReadPrimitive<R> for P where
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for P where
R: Read + ReadEndian<P>,
P: Default,
sourcefn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian()
.
sourcefn read_from_big_endian(read: &mut R) -> Result<Self, Error>
fn read_from_big_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian()
.
sourcefn read_from_native_endian(read: &mut R) -> Result<Self, Error>
fn read_from_native_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian()
.