pub struct Constraint { /* private fields */ }
Expand description
Constraint
describes the constraints properties of a box
entity.
Implementations§
Source§impl Constraint
impl Constraint
The Constraint
is used to manage the constraint porperties of an entity.
Constraints will provide properties that are used to determine the
size requirements of an entity. It will store minimum
and
maximim
values for its height and width, next to the current values.
Sourcepub fn create() -> ConstraintBuilder
pub fn create() -> ConstraintBuilder
Returns a constraint builder.
Sourcepub fn set_height(&mut self, height: f64)
pub fn set_height(&mut self, height: f64)
Sets height.
Sourcepub fn set_min_width(&mut self, min_width: f64)
pub fn set_min_width(&mut self, min_width: f64)
Sets min_width and set width to 0.0.
Sourcepub fn min_height(&self) -> f64
pub fn min_height(&self) -> f64
Gets min_height.
Sourcepub fn set_min_height(&mut self, min_height: f64)
pub fn set_min_height(&mut self, min_height: f64)
Sets min_height and set height to min_height if height < min_height.
Sourcepub fn set_min_size(&mut self, min_width: f64, min_height: f64)
pub fn set_min_size(&mut self, min_width: f64, min_height: f64)
Sets the min size.
Sourcepub fn set_max_width(&mut self, max_width: f64)
pub fn set_max_width(&mut self, max_width: f64)
Sets max_width and set width to 0.0.
Sourcepub fn max_height(&self) -> f64
pub fn max_height(&self) -> f64
Gets max_height.
Sourcepub fn set_max_height(&mut self, max_height: f64)
pub fn set_max_height(&mut self, max_height: f64)
Sets max_height and set height to 0.0.
Sourcepub fn set_max_size(&mut self, max_width: f64, max_height: f64)
pub fn set_max_size(&mut self, max_width: f64, max_height: f64)
Sets the max size.
Trait Implementations§
Source§impl Clone for Constraint
impl Clone for Constraint
Source§fn clone(&self) -> Constraint
fn clone(&self) -> Constraint
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 Constraint
impl Debug for Constraint
Source§impl Default for Constraint
impl Default for Constraint
Source§fn default() -> Constraint
fn default() -> Constraint
Returns the “default value” for a type. Read more
Source§impl From<ConstraintBuilder> for Constraint
impl From<ConstraintBuilder> for Constraint
Source§fn from(builder: ConstraintBuilder) -> Constraint
fn from(builder: ConstraintBuilder) -> Constraint
Converts to this type from the input type.
Source§impl PartialEq for Constraint
impl PartialEq for Constraint
impl Copy for Constraint
impl StructuralPartialEq for Constraint
Auto Trait Implementations§
impl Freeze for Constraint
impl RefUnwindSafe for Constraint
impl Send for Constraint
impl Sync for Constraint
impl Unpin for Constraint
impl UnwindSafe for Constraint
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