pub struct Placeable { /* private fields */ }Expand description
Result of running a measurement pass for a single child.
Concrete struct replacing the former dyn Placeable trait object.
This avoids a heap allocation per node per measure pass — the hot
coordinator path (16-byte value) now lives entirely on the stack.
Implementations§
Source§impl Placeable
impl Placeable
Sourcepub fn value(width: f32, height: f32, node_id: usize) -> Placeable
pub fn value(width: f32, height: f32, node_id: usize) -> Placeable
Creates a pure-value placeable with no side effects on place().
Sourcepub fn value_with_offset(
width: f32,
height: f32,
node_id: usize,
content_offset: (f32, f32),
) -> Placeable
pub fn value_with_offset( width: f32, height: f32, node_id: usize, content_offset: (f32, f32), ) -> Placeable
Creates a pure-value placeable with a content offset.
Sourcepub fn with_place_fn(
width: f32,
height: f32,
node_id: usize,
place_fn: Rc<dyn Fn(f32, f32)>,
) -> Placeable
pub fn with_place_fn( width: f32, height: f32, node_id: usize, place_fn: Rc<dyn Fn(f32, f32)>, ) -> Placeable
Creates a node-backed placeable whose place() triggers a side effect.
Sourcepub fn place(&self, x: f32, y: f32)
pub fn place(&self, x: f32, y: f32)
Places the child at the provided coordinates relative to its parent.
Sourcepub fn content_offset(&self) -> (f32, f32)
pub fn content_offset(&self) -> (f32, f32)
Returns the accumulated content offset from the coordinator chain.
Auto Trait Implementations§
impl Freeze for Placeable
impl !RefUnwindSafe for Placeable
impl !Send for Placeable
impl !Sync for Placeable
impl Unpin for Placeable
impl UnsafeUnpin for Placeable
impl !UnwindSafe for Placeable
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