pub struct Rect { /* private fields */ }Implementations§
Source§impl Rect
impl Rect
pub fn new(layout: RectLayout) -> Self
pub fn empty() -> Self
pub fn layout(layout: RectLayout) -> Self
pub fn styled(style: RectStyle) -> Self
pub fn with_layout(self, layout: RectLayout) -> Self
pub fn style(self, style: RectStyle) -> Self
pub fn width(self, width: Length) -> Self
pub fn height(self, height: Length) -> Self
pub fn size(self, width: Length, height: Length) -> Self
pub fn min_width(self, min_width: u32) -> Self
pub fn min_height(self, min_height: u32) -> Self
pub fn max_width(self, max_width: impl Into<Option<u32>>) -> Self
pub fn max_height(self, max_height: impl Into<Option<u32>>) -> Self
pub fn fill(self, fill: u32) -> Self
pub fn direction(self, direction: Direction) -> Self
pub fn align(self, align: Align) -> Self
pub fn justify(self, justify: Align) -> Self
pub fn overflow(self, overflow: Overflow) -> Self
pub fn position(self, position: Position) -> Self
pub fn inset(self, inset: Inset) -> Self
pub fn absolute(self, inset: Inset) -> Self
pub fn padding(self, padding: Spacing) -> Self
pub fn gap(self, gap: u32) -> Self
pub fn background(self, background: impl Into<Paint>) -> Self
pub fn border(self, border: Border) -> Self
pub fn corner_radius(self, radius: u32) -> Self
pub fn corner_radii(self, radii: CornerRadius) -> Self
pub fn gradient(self, gradient: GradientDirection) -> Self
pub fn opacity(self, opacity: f32) -> Self
pub fn content(self, content: impl Into<Content>) -> Self
pub fn with_surface(self, surface: Surface) -> Self
pub fn begin(_: Bounds) -> Self
pub fn build(bounds: Bounds, content: impl FnOnce(&mut Self)) -> Self
pub fn child(self, child: Rect) -> Self
pub fn children(self, children: impl IntoIterator<Item = Rect>) -> Self
pub fn draw(self) -> Result<()>
pub fn draw_with_commands(self, receiver: RenderReceiver) -> Result<()>
pub fn commands(&self, bounds: Bounds) -> Vec<DrawCommand>
pub fn commands_with_fonts( &self, bounds: Bounds, fonts: &mut FontCtx, ) -> Vec<DrawCommand>
pub fn measure( &self, available_width: u32, available_height: u32, ) -> MeasuredSize
pub fn measure_with_fonts( &self, available_width: u32, available_height: u32, fonts: &mut FontCtx, ) -> MeasuredSize
pub fn hit_test(&self, bounds: Bounds, x: f64, y: f64) -> Option<Hit>
pub fn hit_test_with_fonts( &self, bounds: Bounds, x: f64, y: f64, fonts: &mut FontCtx, ) -> Option<Hit>
pub fn hit_test_path( &self, bounds: Bounds, x: f64, y: f64, path: &mut Vec<usize>, ) -> Option<Bounds>
pub fn hit_test_path_with_fonts( &self, bounds: Bounds, x: f64, y: f64, fonts: &mut FontCtx, path: &mut Vec<usize>, ) -> Option<Bounds>
pub fn paint(&mut self, canvas: &mut Canvas<'_>)
pub fn paint_with_fonts(&mut self, canvas: &mut Canvas<'_>, fonts: &mut FontCtx)
pub fn paint_bgra_with_fonts( &mut self, pixels: &mut [u8], buffer_width: u32, buffer_height: u32, stride: u32, logical_width: u32, logical_height: u32, scale: u32, fonts: &mut FontCtx, ) -> Option<DamageRect>
pub fn paint_bgra_viewport_with_fonts( &mut self, pixels: &mut [u8], buffer_width: u32, buffer_height: u32, stride: u32, logical_width: u32, logical_height: u32, viewport_x: i32, viewport_y: i32, scale: u32, fonts: &mut FontCtx, ) -> Option<DamageRect>
pub fn paint_bgra_transformed_with_fonts( &mut self, pixels: &mut [u8], buffer_width: u32, buffer_height: u32, stride: u32, logical_width: u32, logical_height: u32, scale: u32, transform: PaintTransform, fonts: &mut FontCtx, ) -> Option<DamageRect>
pub fn paint_bgra_transformed_viewport_with_fonts( &mut self, pixels: &mut [u8], buffer_width: u32, buffer_height: u32, stride: u32, logical_width: u32, logical_height: u32, viewport_x: i32, viewport_y: i32, scale: u32, transform: PaintTransform, fonts: &mut FontCtx, ) -> Option<DamageRect>
pub fn paint_bgra( &mut self, pixels: &mut [u8], buffer_width: u32, buffer_height: u32, stride: u32, logical_width: u32, logical_height: u32, scale: u32, ) -> Option<DamageRect>
pub fn paint_bgra_transformed( &mut self, pixels: &mut [u8], buffer_width: u32, buffer_height: u32, stride: u32, logical_width: u32, logical_height: u32, scale: u32, transform: PaintTransform, ) -> Option<DamageRect>
pub fn paint_bgra_transformed_viewport( &mut self, pixels: &mut [u8], buffer_width: u32, buffer_height: u32, stride: u32, logical_width: u32, logical_height: u32, viewport_x: i32, viewport_y: i32, scale: u32, transform: PaintTransform, ) -> Option<DamageRect>
pub fn paint_bgra_viewport( &mut self, pixels: &mut [u8], buffer_width: u32, buffer_height: u32, stride: u32, logical_width: u32, logical_height: u32, viewport_x: i32, viewport_y: i32, scale: u32, ) -> Option<DamageRect>
pub fn paint_scaled_with_fonts( &mut self, canvas: &mut Canvas<'_>, fonts: &mut FontCtx, width: u32, height: u32, scale: u32, )
pub fn paint_transformed_with_fonts( &mut self, canvas: &mut Canvas<'_>, fonts: &mut FontCtx, width: u32, height: u32, scale: u32, transform: PaintTransform, )
pub fn paint_viewport_with_fonts( &mut self, canvas: &mut Canvas<'_>, fonts: &mut FontCtx, width: u32, height: u32, viewport_x: i32, viewport_y: i32, scale: u32, )
pub fn paint_transformed_viewport_with_fonts( &mut self, canvas: &mut Canvas<'_>, fonts: &mut FontCtx, width: u32, height: u32, viewport_x: i32, viewport_y: i32, scale: u32, transform: PaintTransform, )
pub fn render(&mut self, canvas: &mut Canvas<'_>)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Rect
impl !UnwindSafe for Rect
impl Freeze for Rect
impl Send for Rect
impl Sync for Rect
impl Unpin for Rect
impl UnsafeUnpin for Rect
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.