[−][src]Struct winconsole::console::Rect
Defines the coordinates of the corners of a rectangle.
Fields
top: u16
The top of the rectangle.
bottom: u16
The bottom of the rectangle.
left: u16
The left of the rectangle.
right: u16
The right of the rectangle.
Methods
impl Rect
[src]
pub fn new(top: u16, left: u16, right: u16, bottom: u16) -> Rect
[src]
Creates a new Rect.
pub fn bottom_left(self) -> Vector2<u16>
[src]
Returns a Vector representing the bottom-left corner of the rectangle.
Examples
let rect = Rect::new(0, 10, 20, 30); let bottom_left = rect.bottom_left(); assert_eq!(bottom_left, Vector2::new(10, 30))
pub fn bottom_right(self) -> Vector2<u16>
[src]
Returns a Vector representing the bottom-right corner of the rectangle.
Examples
let rect = Rect::new(0, 10, 20, 30); let bottom_right = rect.bottom_right(); assert_eq!(bottom_right, Vector2::new(20, 30))
pub fn top_left(self) -> Vector2<u16>
[src]
Returns a Vector representing the top-left corner of the rectangle.
Examples
let rect = Rect::new(0, 10, 20, 30); let top_left = rect.top_left(); assert_eq!(top_left, Vector2::new(10, 0));
pub fn top_right(self) -> Vector2<u16>
[src]
Returns a Vector representing the top-right corner of the rectangle.
Examples
let rect = Rect::new(0, 10, 20, 30); let top_right = rect.top_right(); assert_eq!(top_right, Vector2::new(20, 0));
Trait Implementations
impl PartialEq<Rect> for Rect
[src]
impl Clone for Rect
[src]
fn clone(&self) -> Rect
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for Rect
[src]
impl Debug for Rect
[src]
impl Serialize for Rect
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for Rect
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,