pub enum LayoutAttribute {
Show 14 variants Left, Right, Top, Bottom, Leading, Trailing, Width, Height, CenterX, CenterY, LastBaseline, FirstBaseline, NotAnAttribute, Unknown(NSInteger),
}
Expand description

Represents attributes for various layouts and constraints.

Note that this only covers attributes that are shared across platforms. In general, this is enough to build apps that work everywhere - but if you need to specify something else, you can handle it yourself with the Unknown variant.

Variants

Left

The left side of the object’s alignment rectangle.

Right

The right side of the object’s alignment rectangle.

Top

The top of the object’s alignment rectangle.

Bottom

The bottom of the object’s alignment rectangle.

Leading

The leading edge of the object’s alignment rectangle.

Trailing

The trailing edge of the object’s alignment rectangle.

Width

The width of the object’s alignment rectangle.

Height

The height of the object’s alignment rectangle.

CenterX

The center along the x-axis of the object’s alignment rectangle.

CenterY

The center along the y-axis of the object’s alignment rectangle.

LastBaseline

The object’s baseline. For objects with more than one line of text, this is the baseline for the bottommost line of text.

FirstBaseline

The object’s baseline. For objects with more than one line of text, this is the baseline for the topmost line of text.

NotAnAttribute

A placeholder value that is used to indicate that the constraint’s second item and second attribute are not used in any calculations.

This can be useful constraint that assigns a constant to an attribute.

Unknown(NSInteger)

Represents an unknown value. This should never be constructed, but acts as a guard against a change in representation on the framework side. If a new value was ever introduced, it’s caught here, and applications can handle it themselves if need be.

Trait Implementations

Formats the value using the given formatter. Read more

Converts to this type from the input type.

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 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.