Struct layout_2020::sizing::ContentSizes
source · pub(crate) struct ContentSizes {
pub min_content: Au,
pub max_content: Au,
}
Fields§
§min_content: Au
§max_content: Au
Implementations§
source§impl ContentSizes
impl ContentSizes
source§impl ContentSizes
impl ContentSizes
sourcepub fn shrink_to_fit(&self, available_size: Au) -> Au
pub fn shrink_to_fit(&self, available_size: Au) -> Au
Clamps the provided amount to be between the min-content and the max-content. This is called “shrink-to-fit” in CSS2, and “fit-content” in CSS Sizing. https://drafts.csswg.org/css2/visudet.html#shrink-to-fit-float https://drafts.csswg.org/css-sizing/#funcdef-width-fit-content
Trait Implementations§
source§impl Add for ContentSizes
impl Add for ContentSizes
source§impl AddAssign for ContentSizes
impl AddAssign for ContentSizes
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moresource§impl Clone for ContentSizes
impl Clone for ContentSizes
source§fn clone(&self) -> ContentSizes
fn clone(&self) -> ContentSizes
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ContentSizes
impl Debug for ContentSizes
source§impl Default for ContentSizes
impl Default for ContentSizes
source§fn default() -> ContentSizes
fn default() -> ContentSizes
Returns the “default value” for a type. Read more
source§impl From<Au> for ContentSizes
impl From<Au> for ContentSizes
source§impl Serialize for ContentSizes
impl Serialize for ContentSizes
source§impl Zero for ContentSizes
impl Zero for ContentSizes
impl Copy for ContentSizes
Auto Trait Implementations§
impl Freeze for ContentSizes
impl RefUnwindSafe for ContentSizes
impl Send for ContentSizes
impl Sync for ContentSizes
impl Unpin for ContentSizes
impl UnwindSafe for ContentSizes
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
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()
.