pub struct LayoutConstraint {
    pub constraint: ShareId<Object>,
    pub offset: f64,
    pub multiplier: f64,
    pub priority: f64,
    pub animator: LayoutConstraintAnimatorProxy,
}
Expand description

A wrapper for NSLayoutConstraint. This both acts as a central path through which to activate constraints, as well as a wrapper for layout constraints that are not axis bound (e.g, width or height).

Fields

constraint: ShareId<Object>

A shared pointer to the underlying view. Provided your view isn’t dropped, this will always be valid.

offset: f64

The offset used in computing this constraint.

multiplier: f64

The multiplier used in computing this constraint.

priority: f64

The priority used in computing this constraint.

animator: LayoutConstraintAnimatorProxy

An animator proxy that can be used inside animation contexts.

Implementations

Sets the offset for this constraint.

Sets the offset of a borrowed constraint.

Set whether this constraint is active or not. If you’re doing this across a batch of constraints, it’s often more performant to batch-deactivate with LayoutConstraint::deactivate().

Call this with your batch of constraints to activate them.

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

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

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.