Struct orbtk_tinyskia::utils::Constraint
source · [−]pub struct Constraint { /* private fields */ }
Expand description
Constraint
describes the constraints properties of a box
entity.
Implementations
sourceimpl 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
sourceimpl Clone for Constraint
impl Clone for Constraint
sourcefn clone(&self) -> Constraint
fn clone(&self) -> Constraint
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Constraint
impl Debug for Constraint
sourceimpl Default for Constraint
impl Default for Constraint
sourcefn default() -> Constraint
fn default() -> Constraint
Returns the “default value” for a type. Read more
sourceimpl From<ConstraintBuilder> for Constraint
impl From<ConstraintBuilder> for Constraint
sourcefn from(builder: ConstraintBuilder) -> Constraint
fn from(builder: ConstraintBuilder) -> Constraint
Converts to this type from the input type.
sourceimpl PartialEq<Constraint> for Constraint
impl PartialEq<Constraint> for Constraint
sourcefn eq(&self, other: &Constraint) -> bool
fn eq(&self, other: &Constraint) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &Constraint) -> bool
fn ne(&self, other: &Constraint) -> bool
This method tests for !=
.
impl Copy for Constraint
impl StructuralPartialEq for Constraint
Auto Trait Implementations
impl RefUnwindSafe for Constraint
impl Send for Constraint
impl Sync for Constraint
impl Unpin for Constraint
impl UnwindSafe for Constraint
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more