pub struct LayoutModifierMeasureResult {
pub size: Size,
pub placement_offset_x: f32,
pub placement_offset_y: f32,
pub alignment_lines: AlignmentLines,
}Expand description
Result of a layout modifier measurement operation.
Unlike MeasureResult which is for MeasurePolicy (multiple children),
this type is specifically for layout modifiers which wrap a single piece
of content and need to specify where that wrapped content should be placed.
Fields§
§size: SizeThe size this modifier will occupy.
placement_offset_x: f32The offset at which to place the wrapped content relative to the top-left corner of this modifier’s bounds. For example, PaddingNode returns (padding.left, padding.top) here to offset the child by the padding amount.
placement_offset_y: f32The vertical offset of the wrapped content, as placement_offset_x.
alignment_lines: AlignmentLinesExplicit alignment lines. Unspecified lines are inherited from wrapped content.
Implementations§
Source§impl LayoutModifierMeasureResult
impl LayoutModifierMeasureResult
Sourcepub fn new(
size: Size,
placement_offset_x: f32,
placement_offset_y: f32,
) -> LayoutModifierMeasureResult
pub fn new( size: Size, placement_offset_x: f32, placement_offset_y: f32, ) -> LayoutModifierMeasureResult
A modifier of size that places its content at the offset.
Sourcepub fn with_size(size: Size) -> LayoutModifierMeasureResult
pub fn with_size(size: Size) -> LayoutModifierMeasureResult
Creates a result with zero placement offset (wrapped content placed at 0,0).
Sourcepub fn with_alignment_lines(
self,
alignment_lines: AlignmentLines,
) -> LayoutModifierMeasureResult
pub fn with_alignment_lines( self, alignment_lines: AlignmentLines, ) -> LayoutModifierMeasureResult
Overrides the wrapped content’s alignment lines in this modifier’s coordinates.
Trait Implementations§
Source§impl Clone for LayoutModifierMeasureResult
impl Clone for LayoutModifierMeasureResult
Source§fn clone(&self) -> LayoutModifierMeasureResult
fn clone(&self) -> LayoutModifierMeasureResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for LayoutModifierMeasureResult
Auto Trait Implementations§
impl Forget for LayoutModifierMeasureResult
impl Freeze for LayoutModifierMeasureResult
impl Move for LayoutModifierMeasureResult
impl RefUnwindSafe for LayoutModifierMeasureResult
impl Send for LayoutModifierMeasureResult
impl Sync for LayoutModifierMeasureResult
impl Unpin for LayoutModifierMeasureResult
impl UnsafeUnpin for LayoutModifierMeasureResult
impl UnwindSafe for LayoutModifierMeasureResult
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more