pub struct Constraints {
pub min: Size,
pub max: Size,
}Fields§
§min: Size§max: SizeImplementations§
Source§impl Constraints
impl Constraints
pub const UNBOUNDED: Self
pub const fn new(min: Size, max: Size) -> Self
pub const fn tight(size: Size) -> Self
pub fn loosen(self) -> Self
Sourcepub fn clamp(self, size: Size) -> Size
pub fn clamp(self, size: Size) -> Size
size within these constraints, as Size::clamp describes:
constraints that cannot hold a size don’t panic.
Trait Implementations§
Source§impl Clone for Constraints
impl Clone for Constraints
impl Copy for Constraints
Source§impl Debug for Constraints
impl Debug for Constraints
Source§impl Default for Constraints
impl Default for Constraints
Source§impl PartialEq for Constraints
impl PartialEq for Constraints
impl StructuralPartialEq for Constraints
Auto Trait Implementations§
impl Forget for Constraints
impl Freeze for Constraints
impl Move for Constraints
impl RefUnwindSafe for Constraints
impl Send for Constraints
impl Sync for Constraints
impl Unpin for Constraints
impl UnsafeUnpin for Constraints
impl UnwindSafe for Constraints
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