LayoutStyle

Struct LayoutStyle 

Source
pub struct LayoutStyle {
Show 27 fields pub display: Display, pub overflow: (Overflow, Overflow), pub scrollbar_width: f32, pub position: Position, pub inset: Rect<LengthPercentageAuto>, pub size: Vector2<Dimension>, pub min_size: Vector2<Dimension>, pub max_size: Vector2<Dimension>, pub aspect_ratio: Option<f32>, pub margin: Rect<LengthPercentageAuto>, pub padding: Rect<LengthPercentage>, pub border: Rect<LengthPercentage>, pub align_items: Option<AlignItems>, pub align_self: Option<AlignSelf>, pub justify_items: Option<AlignItems>, pub justify_self: Option<AlignSelf>, pub align_content: Option<AlignContent>, pub justify_content: Option<JustifyContent>, pub gap: Vector2<LengthPercentage>, pub flex_direction: FlexDirection, pub flex_wrap: FlexWrap, pub flex_basis: Dimension, pub flex_grow: f32, pub flex_shrink: f32, pub grid_auto_flow: GridAutoFlow, pub grid_row: Line<GridPlacement>, pub grid_column: Line<GridPlacement>,
}
Expand description

Defines different aspects and properties of a widget layout.

Fields§

§display: Display

What layout strategy should be used?

§overflow: (Overflow, Overflow)

How children overflowing their container should affect layout.

§scrollbar_width: f32

How much space (in points) should be reserved for scrollbars.

§position: Position

What should the position value of this struct use as a base offset?

§inset: Rect<LengthPercentageAuto>

How should the position of this element be tweaked relative to the layout defined?

§size: Vector2<Dimension>

Sets the initial size of the item.

§min_size: Vector2<Dimension>

Controls the minimum size of the item.

§max_size: Vector2<Dimension>

Controls the maximum size of the item.

§aspect_ratio: Option<f32>

Sets the preferred aspect ratio for the item

The ratio is calculated as width divided by height.

§margin: Rect<LengthPercentageAuto>

How large should the margin be on each side?

§padding: Rect<LengthPercentage>

How large should the padding be on each side?

§border: Rect<LengthPercentage>

How large should the border be on each side?

§align_items: Option<AlignItems>

How this node’s children aligned in the cross/block axis?

§align_self: Option<AlignSelf>

How this node should be aligned in the cross/block axis Falls back to the parents AlignItems if not set.

§justify_items: Option<AlignItems>

How this node’s children should be aligned in the inline axis.

§justify_self: Option<AlignSelf>

How this node should be aligned in the inline axis Falls back to the parents JustifyItems if not set.

§align_content: Option<AlignContent>

How should content contained within this item be aligned in the cross/block axis?

§justify_content: Option<JustifyContent>

How should content contained within this item be aligned in the main/inline axis?

§gap: Vector2<LengthPercentage>

How large should the gaps between items in a grid or flex container be?

§flex_direction: FlexDirection

Which direction does the main axis flow in?

§flex_wrap: FlexWrap

Should elements wrap, or stay in a single line?

§flex_basis: Dimension

Sets the initial main axis size of the item.

§flex_grow: f32

The relative rate at which this item grows when it is expanding to fill space.

0.0 is the default value, and this value must be positive.

§flex_shrink: f32

The relative rate at which this item shrinks when it is contracting to fit into space.

1.0 is the default value, and this value must be positive.

§grid_auto_flow: GridAutoFlow

Controls how items get placed into the grid for auto-placed items.

§grid_row: Line<GridPlacement>

Defines which row in the grid the item should start and end at.

§grid_column: Line<GridPlacement>

Defines which column in the grid the item should start and end at.

Trait Implementations§

Source§

impl Clone for LayoutStyle

Source§

fn clone(&self) -> LayoutStyle

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LayoutStyle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for LayoutStyle

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<LayoutStyle> for Style

Source§

fn from(value: LayoutStyle) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for LayoutStyle

Source§

fn eq(&self, other: &LayoutStyle) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for LayoutStyle

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,