pub struct IntrinsicSizes {
pub min_content_width: f32,
pub max_content_width: f32,
pub preferred_width: Option<f32>,
pub min_content_height: f32,
pub max_content_height: f32,
pub preferred_height: Option<f32>,
pub preferred_aspect_ratio: Option<f32>,
}Expand description
Represents the intrinsic sizing information for an element, calculated without knowledge of the final containing block size.
Fields§
§min_content_width: f32§2.1 min-content inline size: inline size fitting contents if all soft wraps taken.
max_content_width: f32§2.1 max-content inline size: narrowest inline size if no soft wraps taken.
preferred_width: Option<f32>The width specified by CSS properties, if any.
min_content_height: f32§2.1 min-content block size: for block containers, tables, and inline boxes, equivalent to max-content block size.
max_content_height: f32§2.1 max-content block size: “ideal” block size, usually content height after layout.
preferred_height: Option<f32>The height specified by CSS properties, if any.
preferred_aspect_ratio: Option<f32>The element’s natural aspect ratio (inline / block), if it has one — e.g. a
replaced element with intrinsic dimensions. None for non-replaced content.
Implementations§
Source§impl IntrinsicSizes
impl IntrinsicSizes
Sourcepub const fn fit_content_width(&self, available_inline_size: f32) -> f32
pub const fn fit_content_width(&self, available_inline_size: f32) -> f32
CSS Sizing §2.1 fit-content inline size:
clamp(min-content, stretch-fit, max-content), where the stretch-fit size is the
available_inline_size (the space the containing block offers in the inline axis).
Equal to max(min_content, min(stretch_fit, max_content)).
Sourcepub const fn fit_content_height(&self, available_block_size: f32) -> f32
pub const fn fit_content_height(&self, available_block_size: f32) -> f32
CSS Sizing §2.1 fit-content block size:
clamp(min-content, stretch-fit, max-content) in the block axis.
Trait Implementations§
Source§impl Clone for IntrinsicSizes
impl Clone for IntrinsicSizes
Source§fn clone(&self) -> IntrinsicSizes
fn clone(&self) -> IntrinsicSizes
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 IntrinsicSizes
Source§impl Debug for IntrinsicSizes
impl Debug for IntrinsicSizes
Source§impl Default for IntrinsicSizes
impl Default for IntrinsicSizes
Source§fn default() -> IntrinsicSizes
fn default() -> IntrinsicSizes
Auto Trait Implementations§
impl Freeze for IntrinsicSizes
impl RefUnwindSafe for IntrinsicSizes
impl Send for IntrinsicSizes
impl Sync for IntrinsicSizes
impl Unpin for IntrinsicSizes
impl UnsafeUnpin for IntrinsicSizes
impl UnwindSafe for IntrinsicSizes
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,
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