pub struct ConstraintBuilder { /* private fields */ }
Expand description
Used to capture constraint properties.
Implementations§
Source§impl ConstraintBuilder
impl ConstraintBuilder
The ConstraintBuilder
is used to crate 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 min_height(self, min_height: impl Into<f64>) -> Self
pub fn min_height(self, min_height: impl Into<f64>) -> Self
Inserts a new min_height.
Sourcepub fn min_size(
self,
min_width: impl Into<f64>,
min_height: impl Into<f64>,
) -> Self
pub fn min_size( self, min_width: impl Into<f64>, min_height: impl Into<f64>, ) -> Self
Inserts a new min_size.
Sourcepub fn max_height(self, max_height: impl Into<f64>) -> Self
pub fn max_height(self, max_height: impl Into<f64>) -> Self
Inserts a new max_height.
Sourcepub fn max_size(
self,
max_width: impl Into<f64>,
max_height: impl Into<f64>,
) -> Self
pub fn max_size( self, max_width: impl Into<f64>, max_height: impl Into<f64>, ) -> Self
Inserts a new min_size.
Sourcepub fn build(self) -> Constraint
pub fn build(self) -> Constraint
Builds the constraint.
Trait Implementations§
Source§impl Default for ConstraintBuilder
impl Default for ConstraintBuilder
Source§fn default() -> ConstraintBuilder
fn default() -> ConstraintBuilder
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) -> Self
fn from(builder: ConstraintBuilder) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ConstraintBuilder
impl RefUnwindSafe for ConstraintBuilder
impl Send for ConstraintBuilder
impl Sync for ConstraintBuilder
impl Unpin for ConstraintBuilder
impl UnwindSafe for ConstraintBuilder
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