pub struct LayoutState {
pub measurement_constraints: Constraints,
pub content_offset: Point,
/* private fields */
}Expand description
Retained layout state for a LayoutNode. This mirrors Jetpack Compose’s approach where each node stores its own measured size and placed position, eliminating the need for per-frame LayoutTree reconstruction.
Fields§
§measurement_constraints: ConstraintsThe constraints used for the last measurement.
content_offset: PointOffset of the content box relative to the node origin (e.g. due to padding).
Implementations§
Source§impl LayoutState
impl LayoutState
pub fn size(&self) -> Size
pub fn position(&self) -> Point
pub fn is_placed(&self) -> bool
Sourcepub fn set_size(&mut self, size: Size)
pub fn set_size(&mut self, size: Size)
Writes the measured size, self-reporting an actual change to the scene phase.
Sourcepub fn place(&mut self, position: Point)
pub fn place(&mut self, position: Point)
Writes the placed position and marks the node placed, self-reporting an actual move to the scene phase.
Sourcepub fn clear_placed(&mut self)
pub fn clear_placed(&mut self)
Clears the placed flag at the start of a layout pass.
Trait Implementations§
Source§impl Clone for LayoutState
impl Clone for LayoutState
Source§fn clone(&self) -> LayoutState
fn clone(&self) -> LayoutState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LayoutState
impl Debug for LayoutState
Auto Trait Implementations§
impl Freeze for LayoutState
impl RefUnwindSafe for LayoutState
impl Send for LayoutState
impl Sync for LayoutState
impl Unpin for LayoutState
impl UnsafeUnpin for LayoutState
impl UnwindSafe for LayoutState
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