Struct layout_2020::positioned::AbsoluteAxisSolver
source · struct AbsoluteAxisSolver<'a> {Show 13 fields
axis: AxisDirection,
containing_size: Au,
padding_border_sum: Au,
computed_margin_start: AuOrAuto,
computed_margin_end: AuOrAuto,
computed_size: Size<Au>,
computed_min_size: Size<Au>,
computed_max_size: Size<Au>,
avoid_negative_margin_start: bool,
box_offsets: AbsoluteBoxOffsets<'a>,
static_position_rect_axis: RectAxis,
alignment: AlignFlags,
flip_anchor: bool,
}
Fields§
§axis: AxisDirection
§containing_size: Au
§padding_border_sum: Au
§computed_margin_start: AuOrAuto
§computed_margin_end: AuOrAuto
§computed_size: Size<Au>
§computed_min_size: Size<Au>
§computed_max_size: Size<Au>
§avoid_negative_margin_start: bool
§box_offsets: AbsoluteBoxOffsets<'a>
§static_position_rect_axis: RectAxis
§alignment: AlignFlags
§flip_anchor: bool
Implementations§
source§impl<'a> AbsoluteAxisSolver<'a>
impl<'a> AbsoluteAxisSolver<'a>
sourcefn solve(
&self,
get_content_size: Option<impl FnOnce() -> ContentSizes>,
) -> AxisResult
fn solve( &self, get_content_size: Option<impl FnOnce() -> ContentSizes>, ) -> AxisResult
This unifies some of the parts in common in:
- https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-width
- https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-height
… and:
- https://drafts.csswg.org/css2/visudet.html#abs-replaced-width
- https://drafts.csswg.org/css2/visudet.html#abs-replaced-height
In the replaced case, size
is never Auto
.
fn solve_tentatively(&mut self) -> AxisResult
fn solve_with_size(&mut self, size: Au) -> AxisResult
fn origin_for_alignment_or_justification( &self, margin_box_axis: RectAxis, ) -> Option<Au>
fn solve_alignment( &self, margin_box_rect: LogicalRect<Au>, content_box_rect: &mut LogicalRect<Au>, )
Auto Trait Implementations§
impl<'a> Freeze for AbsoluteAxisSolver<'a>
impl<'a> RefUnwindSafe for AbsoluteAxisSolver<'a>
impl<'a> Send for AbsoluteAxisSolver<'a>
impl<'a> Sync for AbsoluteAxisSolver<'a>
impl<'a> Unpin for AbsoluteAxisSolver<'a>
impl<'a> UnwindSafe for AbsoluteAxisSolver<'a>
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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 moresource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert