Skip to main content

Constraints

Trait Constraints 

Source
pub trait Constraints {
    // Required methods
    fn is_tight(&self) -> bool;
    fn is_normalized(&self) -> bool;

    // Provided method
    fn debug_assert_is_valid(&self, is_applied_constraint: bool) -> bool { ... }
}
Expand description

Immutable layout constraints.

Flutter’s counterpart is the abstract Constraints class.

Required Methods§

Source

fn is_tight(&self) -> bool

Whether there is exactly one size possible given these constraints.

Source

fn is_normalized(&self) -> bool

Whether the constraint is expressed in a consistent manner.

Provided Methods§

Source

fn debug_assert_is_valid(&self, is_applied_constraint: bool) -> bool

Asserts that the constraints are valid.

Returns the same as is_normalized if asserts are disabled.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§