Skip to main content

Rect

Struct Rect 

Source
pub struct Rect { /* private fields */ }

Implementations§

Source§

impl Rect

Source

pub fn new(layout: RectLayout) -> Self

Source

pub fn empty() -> Self

Source

pub fn layout(layout: RectLayout) -> Self

Source

pub fn styled(style: RectStyle) -> Self

Source

pub fn with_layout(self, layout: RectLayout) -> Self

Source

pub fn style(self, style: RectStyle) -> Self

Source

pub fn width(self, width: Length) -> Self

Source

pub fn height(self, height: Length) -> Self

Source

pub fn size(self, width: Length, height: Length) -> Self

Source

pub fn min_width(self, min_width: u32) -> Self

Source

pub fn min_height(self, min_height: u32) -> Self

Source

pub fn max_width(self, max_width: impl Into<Option<u32>>) -> Self

Source

pub fn max_height(self, max_height: impl Into<Option<u32>>) -> Self

Source

pub fn fill(self, fill: u32) -> Self

Source

pub fn direction(self, direction: Direction) -> Self

Source

pub fn align(self, align: Align) -> Self

Source

pub fn justify(self, justify: Align) -> Self

Source

pub fn overflow(self, overflow: Overflow) -> Self

Source

pub fn position(self, position: Position) -> Self

Source

pub fn inset(self, inset: Inset) -> Self

Source

pub fn absolute(self, inset: Inset) -> Self

Source

pub fn padding(self, padding: Spacing) -> Self

Source

pub fn gap(self, gap: u32) -> Self

Source

pub fn background(self, background: impl Into<Paint>) -> Self

Source

pub fn border(self, border: Border) -> Self

Source

pub fn corner_radius(self, radius: u32) -> Self

Source

pub fn corner_radii(self, radii: CornerRadius) -> Self

Source

pub fn gradient(self, gradient: GradientDirection) -> Self

Source

pub fn opacity(self, opacity: f32) -> Self

Source

pub fn content(self, content: impl Into<Content>) -> Self

Source

pub fn with_surface(self, surface: Surface) -> Self

Source

pub fn begin(_: Bounds) -> Self

Source

pub fn build(bounds: Bounds, content: impl FnOnce(&mut Self)) -> Self

Source

pub fn child(self, child: Rect) -> Self

Source

pub fn children(self, children: impl IntoIterator<Item = Rect>) -> Self

Source

pub fn draw(self) -> Result<()>

Source

pub fn draw_with_commands(self, receiver: RenderReceiver) -> Result<()>

Source

pub fn commands(&self, bounds: Bounds) -> Vec<DrawCommand>

Source

pub fn commands_with_fonts( &self, bounds: Bounds, fonts: &mut FontCtx, ) -> Vec<DrawCommand>

Source

pub fn measure( &self, available_width: u32, available_height: u32, ) -> MeasuredSize

Source

pub fn measure_with_fonts( &self, available_width: u32, available_height: u32, fonts: &mut FontCtx, ) -> MeasuredSize

Source

pub fn hit_test(&self, bounds: Bounds, x: f64, y: f64) -> Option<Hit>

Source

pub fn hit_test_with_fonts( &self, bounds: Bounds, x: f64, y: f64, fonts: &mut FontCtx, ) -> Option<Hit>

Source

pub fn hit_test_path( &self, bounds: Bounds, x: f64, y: f64, path: &mut Vec<usize>, ) -> Option<Bounds>

Source

pub fn hit_test_path_with_fonts( &self, bounds: Bounds, x: f64, y: f64, fonts: &mut FontCtx, path: &mut Vec<usize>, ) -> Option<Bounds>

Source

pub fn paint(&mut self, canvas: &mut Canvas<'_>)

Source

pub fn paint_with_fonts(&mut self, canvas: &mut Canvas<'_>, fonts: &mut FontCtx)

Source

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>

Source

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>

Source

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>

Source

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>

Source

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>

Source

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>

Source

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>

Source

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>

Source

pub fn paint_scaled_with_fonts( &mut self, canvas: &mut Canvas<'_>, fonts: &mut FontCtx, width: u32, height: u32, scale: u32, )

Source

pub fn paint_transformed_with_fonts( &mut self, canvas: &mut Canvas<'_>, fonts: &mut FontCtx, width: u32, height: u32, scale: u32, transform: PaintTransform, )

Source

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, )

Source

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, )

Source

pub fn render(&mut self, canvas: &mut Canvas<'_>)

Trait Implementations§

Source§

impl Clone for Rect

Source§

fn clone(&self) -> Rect

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for Rect

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

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>

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)

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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.