pub(crate) struct Sizes {
pub preferred: Size<Au>,
pub min: Size<Au>,
pub max: Size<Au>,
}
Fields§
§preferred: Size<Au>
§min: Size<Au>
§max: Size<Au>
Implementations§
Source§impl Sizes
impl Sizes
pub(crate) fn new(preferred: Size<Au>, min: Size<Au>, max: Size<Au>) -> Self
Sourcepub(crate) fn resolve(
&self,
axis: Direction,
automatic_size: Size<Au>,
get_automatic_minimum_size: impl FnOnce() -> Au,
stretch_size: Option<Au>,
get_content_size: impl FnOnce() -> ContentSizes,
is_table: bool,
) -> Au
pub(crate) fn resolve( &self, axis: Direction, automatic_size: Size<Au>, get_automatic_minimum_size: impl FnOnce() -> Au, stretch_size: Option<Au>, get_content_size: impl FnOnce() -> ContentSizes, is_table: bool, ) -> Au
Resolves the three sizes into a single numerical value.
Sourcepub(crate) fn resolve_each(
&self,
automatic_size: Size<Au>,
get_automatic_minimum_size: impl FnOnce() -> Au,
stretch_size: Option<Au>,
get_content_size: impl FnOnce() -> ContentSizes,
is_table: bool,
) -> (Au, Au, Option<Au>)
pub(crate) fn resolve_each( &self, automatic_size: Size<Au>, get_automatic_minimum_size: impl FnOnce() -> Au, stretch_size: Option<Au>, get_content_size: impl FnOnce() -> ContentSizes, is_table: bool, ) -> (Au, Au, Option<Au>)
Resolves each of the three sizes into a numerical value, separately.
- The 1st returned value is the resolved preferred size.
- The 2nd returned value is the resolved minimum size.
- The 3rd returned value is the resolved maximum size.
None
means no maximum.
Sourcepub(crate) fn resolve_extrinsic(
&self,
automatic_size: Size<Au>,
automatic_minimum_size: Au,
stretch_size: Option<Au>,
) -> SizeConstraint
pub(crate) fn resolve_extrinsic( &self, automatic_size: Size<Au>, automatic_minimum_size: Au, stretch_size: Option<Au>, ) -> SizeConstraint
Tries to extrinsically resolve the three sizes into a single SizeConstraint
.
Values that are intrinsic or need stretch_size
when it’s None
are handled as such:
- On the preferred size, they make the returned value be an indefinite
SizeConstraint::MinMax
. - On the min size, they are treated as
auto
, enforcing the automatic minimum size. - On the max size, they are treated as
none
, enforcing no maximum.
Sourcepub(crate) fn resolve_each_extrinsic(
&self,
automatic_size: Size<Au>,
automatic_minimum_size: Au,
stretch_size: Option<Au>,
) -> (Option<Au>, Au, Option<Au>)
pub(crate) fn resolve_each_extrinsic( &self, automatic_size: Size<Au>, automatic_minimum_size: Au, stretch_size: Option<Au>, ) -> (Option<Au>, Au, Option<Au>)
Tries to extrinsically resolve each of the three sizes into a numerical value, separately.
This can’t resolve values that are intrinsic or need stretch_size
but it’s None
.
- The 1st returned value is the resolved preferred size. If it can’t be resolved then
the returned value is
None
. Note that this is different than treating it asauto
. TODO: This needs to be discussed in https://github.com/w3c/csswg-drafts/issues/11387. - The 2nd returned value is the resolved minimum size. If it can’t be resolved then we
treat it as the initial
auto
, returning the automatic minimum size. - The 3rd returned value is the resolved maximum size. If it can’t be resolved then we
treat it as the initial
none
, returningNone
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Sizes
impl RefUnwindSafe for Sizes
impl Send for Sizes
impl Sync for Sizes
impl Unpin for Sizes
impl UnwindSafe for Sizes
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. 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
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.