pub struct Limits {
pub min: Size,
pub max: Size,
pub compression: Size<bool>,
pub infinite: Size<bool>,
}Expand description
A set of size constraints for layouting.
Fields§
§min: SizeThe minimum bounds.
max: SizeThe maximum bounds.
compression: Size<bool>Whether fluid lengths should be compressed to intrinsic dimensions.
infinite: Size<bool>Whether intrinsic dimensions can exceed maximum bounds. The maximum boundary becomes a hint in this case.
Implementations§
Source§impl Limits
impl Limits
Sourcepub const fn with_flags(
min: Size,
max: Size,
compression: Size<bool>,
infinite: Size<bool>,
) -> Self
pub const fn with_flags( min: Size, max: Size, compression: Size<bool>, infinite: Size<bool>, ) -> Self
Sourcepub fn bounds(&self) -> Size
pub fn bounds(&self) -> Size
Returns the maximum Size of the Limits.
On axes with infinite bounds, the value is
f32::INFINITY, as the maximum boundary becomes a hint in this
case.
Sourcepub fn width(self, width: impl Into<Length>) -> Limits
pub fn width(self, width: impl Into<Length>) -> Limits
Applies a width constraint to the current Limits.
Sourcepub fn height(self, height: impl Into<Length>) -> Limits
pub fn height(self, height: impl Into<Length>) -> Limits
Applies a height constraint to the current Limits.
Sourcepub fn resolve(
&self,
width: impl Into<Length>,
height: impl Into<Length>,
intrinsic_size: Size,
) -> Size
pub fn resolve( &self, width: impl Into<Length>, height: impl Into<Length>, intrinsic_size: Size, ) -> Size
Trait Implementations§
impl Copy for Limits
impl StructuralPartialEq for Limits
Auto Trait Implementations§
impl Freeze for Limits
impl RefUnwindSafe for Limits
impl Send for Limits
impl Sync for Limits
impl Unpin for Limits
impl UnsafeUnpin for Limits
impl UnwindSafe for Limits
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