Struct shape_core::Rectangle
source · pub struct Rectangle<T> {
pub x: T,
pub y: T,
pub w: T,
pub h: T,
}Expand description
Fields§
§x: Torigin x point of the rectangle
y: Torigin y point of the rectangle
w: Twidth of the rectangle_2d
h: Theight of the rectangle_2d
Implementations§
source§impl<T> Rectangle<T>
impl<T> Rectangle<T>
Constructors for rectangle_2d
sourcepub fn from_origin<P>(origin: P, width: T, height: T) -> Selfwhere
T: Clone + One + Add<Output = T> + Sub<Output = T> + Div<Output = T>,
P: Into<Point<T>>,
pub fn from_origin<P>(origin: P, width: T, height: T) -> Selfwhere T: Clone + One + Add<Output = T> + Sub<Output = T> + Div<Output = T>, P: Into<Point<T>>,
sourcepub fn from_center<P>(center: P, width: T, height: T) -> Selfwhere
T: Clone + One + Add<Output = T> + Sub<Output = T> + Div<Output = T>,
P: Into<Point<T>>,
pub fn from_center<P>(center: P, width: T, height: T) -> Selfwhere T: Clone + One + Add<Output = T> + Sub<Output = T> + Div<Output = T>, P: Into<Point<T>>,
Trait Implementations§
source§impl<'de, T> Deserialize<'de> for Rectangle<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Rectangle<T>where T: Deserialize<'de>,
source§fn 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