pub struct Placeable { /* private fields */ }Expand description
Result of running a measurement pass for a single child.
Carries measurement and alignment lines without allocating a trait object.
Implementations§
Source§impl Placeable
impl Placeable
Sourcepub fn value(width: f32, height: f32, node_id: NodeId) -> Self
pub fn value(width: f32, height: f32, node_id: NodeId) -> Self
Creates a pure-value placeable with no side effects on place().
Sourcepub fn value_with_offset(
width: f32,
height: f32,
node_id: NodeId,
content_offset: (f32, f32),
) -> Self
pub fn value_with_offset( width: f32, height: f32, node_id: NodeId, content_offset: (f32, f32), ) -> Self
Creates a pure-value placeable with a content offset.
Sourcepub fn with_place_target(
width: f32,
height: f32,
node_id: NodeId,
target: Rc<dyn PlaceTarget>,
) -> Self
pub fn with_place_target( width: f32, height: f32, node_id: NodeId, target: Rc<dyn PlaceTarget>, ) -> Self
Creates a node-backed placeable whose place() tells target. The
target is shared, so a node’s own measure state can be it without an
allocation per measure.
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.
Sourcepub fn with_alignment_lines(self, alignment_lines: AlignmentLines) -> Self
pub fn with_alignment_lines(self, alignment_lines: AlignmentLines) -> Self
Supplies alignment lines relative to this placeable’s top edge.
Sourcepub fn alignment_lines(&self) -> AlignmentLines
pub fn alignment_lines(&self) -> AlignmentLines
Returns the text baselines relative to this placeable’s top edge.
Auto Trait Implementations§
impl !RefUnwindSafe for Placeable
impl !Send for Placeable
impl !Sync for Placeable
impl !UnwindSafe for Placeable
impl Freeze for Placeable
impl Unpin for Placeable
impl UnsafeUnpin 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