use crate::*; /// Drawing target. pub trait Out: Send + Sync + Sized { /// Unit of length type Unit: Coordinate; /// Rectangle without offset type Size: Size; /// Rectangle with offset type Area: Area; /// Render drawable in area specified by `T::layout(self.area())` #[inline] fn place <'t, T: Content + ?Sized> ( &mut self, content: &'t T ) { self.place_at(content.layout(self.area()), content) } /// Render drawable in area specified by `area` fn place_at <'t, T: Draw + ?Sized> (&mut self, area: Self::Area, content: &'t T); /// Current output area fn area (&self) -> Self::Area; #[inline] fn x (&self) -> Self::Unit { self.area().x() } #[inline] fn y (&self) -> Self::Unit { self.area().y() } #[inline] fn w (&self) -> Self::Unit { self.area().w() } #[inline] fn h (&self) -> Self::Unit { self.area().h() } #[inline] fn wh (&self) -> Self::Size { self.area().wh().into() } /// Mutable pointer to area. fn area_mut (&mut self) -> &mut Self::Area; }