pub struct Rect<T, Coord> {
pub left: T,
pub top: T,
pub right: T,
pub bottom: T,
/* private fields */
}
Fields§
§left: T
§top: T
§right: T
§bottom: T
Implementations§
Source§impl<T, Coord> Rect<T, Coord>
impl<T, Coord> Rect<T, Coord>
pub const fn new(left: T, top: T, right: T, bottom: T) -> Rect<T, Coord>
pub fn from_positions( left_top: impl Into<Position<T, Coord>>, right_bottom: impl Into<Position<T, Coord>>, ) -> Rect<T, Coord>
pub fn from_position_size( position: impl Into<Position<T, Coord>>, size: impl Into<Size<T, Coord>>, ) -> Rect<T, Coord>
pub fn left_top(&self) -> Position<T, Coord>where
T: Clone,
pub fn left_bottom(&self) -> Position<T, Coord>where
T: Clone,
pub fn right_top(&self) -> Position<T, Coord>where
T: Clone,
pub fn right_bottom(&self) -> Position<T, Coord>where
T: Clone,
pub fn size(&self) -> Size<T, Coord>
Trait Implementations§
Source§impl<'de, T, Coord> Deserialize<'de> for Rect<T, Coord>where
T: Deserialize<'de>,
impl<'de, T, Coord> Deserialize<'de> for Rect<T, Coord>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Rect<T, Coord>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Rect<T, Coord>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T, Coord> From<(T, T, T, T)> for Rect<T, Coord>
impl<T, Coord> From<(T, T, T, T)> for Rect<T, Coord>
Source§fn from(value: (T, T, T, T)) -> Rect<T, Coord>
fn from(value: (T, T, T, T)) -> Rect<T, Coord>
Converts to this type from the input type.
Source§impl<T, Coord> Serialize for Rect<T, Coord>where
T: Serialize,
impl<T, Coord> Serialize for Rect<T, Coord>where
T: Serialize,
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl<T> ToPhysical<T> for Rect<T, Logical>
impl<T> ToPhysical<T> for Rect<T, Logical>
impl<T, Coord> Copy for Rect<T, Coord>
impl<T, Coord> Eq for Rect<T, Coord>
impl<T, Coord> StructuralPartialEq for Rect<T, Coord>
Auto Trait Implementations§
impl<T, Coord> Freeze for Rect<T, Coord>where
T: Freeze,
impl<T, Coord> RefUnwindSafe for Rect<T, Coord>where
T: RefUnwindSafe,
Coord: RefUnwindSafe,
impl<T, Coord> Send for Rect<T, Coord>
impl<T, Coord> Sync for Rect<T, Coord>
impl<T, Coord> Unpin for Rect<T, Coord>
impl<T, Coord> UnwindSafe for Rect<T, Coord>where
T: UnwindSafe,
Coord: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more