pub trait RenderObject: 'static {
// Required methods
fn layout(&mut self, constraints: Constraints) -> Size;
fn paint(&self, canvas: &mut Canvas, size: Size);
// Provided method
fn hit_test(&self, point: Point, size: Size) -> bool { ... }
}Expand description
The core trait implemented by every node in the render tree.
Each RenderObject is responsible for measuring itself given layout
Constraints, painting into a Canvas, and reporting hit-test results.
Required Methods§
Sourcefn layout(&mut self, constraints: Constraints) -> Size
fn layout(&mut self, constraints: Constraints) -> Size
Measures the object under the given constraints and returns its size.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".