pub struct Constraint { /* private fields */ }
Expand description

Constraint describes the constraints properties of a box entity.

Implementations

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.

Returns a constraint builder.

Gets width.

Sets width.

Gets height.

Sets height.

Gets the size.

Sets the size.

Gets min_width.

Sets min_width and set width to 0.0.

Gets min_height.

Sets min_height and set height to min_height if height < min_height.

Gets the min_size.

Sets the min size.

Gets max_width.

Sets max_width and set width to 0.0.

Gets max_height.

Sets max_height and set height to 0.0.

Gets the max_size.

Sets the max size.

Adjust the given size.

Asures that size will respect the defined box values for min and max constraints. The value will be adapted if outside of a bound.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Converts to this type from the input type.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.