pub struct Constraints {
pub grow: Option<f32>,
pub fixed: Option<f32>,
pub min: Option<f32>,
pub max: Option<f32>,
pub min_width: Option<f32>,
pub max_width: Option<f32>,
pub min_height: Option<f32>,
pub max_height: Option<f32>,
pub align: Option<Align>,
pub size_mode: Option<SizeMode>,
}Expand description
Sizing constraints for a panel or container within its parent.
Controls how the node participates in flex layout. grow and fixed are
mutually exclusive: grow assigns a flex-grow weight while fixed sets an
absolute size in pixels. Optional min/max bounds and axis-specific
min_width/max_width/min_height/max_height further restrict the
resolved size. align overrides cross-axis alignment and size_mode
switches to CSS intrinsic sizing.
Fields§
§grow: Option<f32>Mutually exclusive with fixed.
fixed: Option<f32>Mutually exclusive with grow.
min: Option<f32>§max: Option<f32>§min_width: Option<f32>§max_width: Option<f32>§min_height: Option<f32>§max_height: Option<f32>§align: Option<Align>§size_mode: Option<SizeMode>Overrides flex-basis in CSS emission.
Implementations§
Source§impl Constraints
impl Constraints
pub fn min(self, value: f32) -> Self
pub fn max(self, value: f32) -> Self
pub fn min_width(self, value: f32) -> Self
pub fn max_width(self, value: f32) -> Self
pub fn min_height(self, value: f32) -> Self
pub fn max_height(self, value: f32) -> Self
pub fn align(self, value: Align) -> Self
pub fn size_mode(self, value: SizeMode) -> Self
pub fn validate(&self) -> Result<(), PaneError>
Trait Implementations§
Source§impl Clone for Constraints
impl Clone for Constraints
Source§fn clone(&self) -> Constraints
fn clone(&self) -> Constraints
Returns a duplicate 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 Constraints
impl Debug for Constraints
Source§impl Default for Constraints
impl Default for Constraints
Source§fn default() -> Constraints
fn default() -> Constraints
Returns the “default value” for a type. Read more
Source§impl PartialEq for Constraints
impl PartialEq for Constraints
impl Copy for Constraints
impl StructuralPartialEq for Constraints
Auto Trait Implementations§
impl Freeze for Constraints
impl RefUnwindSafe for Constraints
impl Send for Constraints
impl Sync for Constraints
impl Unpin for Constraints
impl UnsafeUnpin for Constraints
impl UnwindSafe for Constraints
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