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 new() -> ConstraintBuilder
pub fn new() -> ConstraintBuilder
Creates a new ConstraintBuilder
with default values.
Sourcepub fn width(self, width: impl Into<f64>) -> ConstraintBuilder
pub fn width(self, width: impl Into<f64>) -> ConstraintBuilder
Inserts a new width.
Sourcepub fn height(self, height: impl Into<f64>) -> ConstraintBuilder
pub fn height(self, height: impl Into<f64>) -> ConstraintBuilder
Inserts a new height.
Sourcepub fn size(
self,
width: impl Into<f64>,
height: impl Into<f64>,
) -> ConstraintBuilder
pub fn size( self, width: impl Into<f64>, height: impl Into<f64>, ) -> ConstraintBuilder
Inserts a new size.
Sourcepub fn min_width(self, min_width: impl Into<f64>) -> ConstraintBuilder
pub fn min_width(self, min_width: impl Into<f64>) -> ConstraintBuilder
Inserts a new min_width.
Sourcepub fn min_height(self, min_height: impl Into<f64>) -> ConstraintBuilder
pub fn min_height(self, min_height: impl Into<f64>) -> ConstraintBuilder
Inserts a new min_height.
Sourcepub fn min_size(
self,
min_width: impl Into<f64>,
min_height: impl Into<f64>,
) -> ConstraintBuilder
pub fn min_size( self, min_width: impl Into<f64>, min_height: impl Into<f64>, ) -> ConstraintBuilder
Inserts a new min_size.
Sourcepub fn max_width(self, max_width: impl Into<f64>) -> ConstraintBuilder
pub fn max_width(self, max_width: impl Into<f64>) -> ConstraintBuilder
Inserts a new max_width.
Sourcepub fn max_height(self, max_height: impl Into<f64>) -> ConstraintBuilder
pub fn max_height(self, max_height: impl Into<f64>) -> ConstraintBuilder
Inserts a new max_height.
Sourcepub fn max_size(
self,
max_width: impl Into<f64>,
max_height: impl Into<f64>,
) -> ConstraintBuilder
pub fn max_size( self, max_width: impl Into<f64>, max_height: impl Into<f64>, ) -> ConstraintBuilder
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) -> Constraint
fn from(builder: ConstraintBuilder) -> Constraint
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