pub struct VStack<const N: usize> {
    pub flex: FlexArray<N>,
    pub children: Children<N>,
    pub on_key: KeyHandler,
    pub on_mouse: MouseHandler,
}
Expand description

A component that renders a vertical stack of components.

The flex argument specifies the amount of space allocated to each child, similar to the flex css property. See the FlexArray documentation for details.

An example usage would be,

#[component(Root)]
fn render() {
  render! {
    VStack(flex: [1, 2, 3]) {
      Section(title: "Top")
      Section(title: "Middle")
      Section(title: "Bottom")
    }
  }
}

Will render the following:

vstack

Fields§

§flex: FlexArray<N>§children: Children<N>§on_key: KeyHandler§on_mouse: MouseHandler

Implementations§

source§

impl<const N: usize> Stack<N>

source

pub fn new( flex: FlexArray<N>, children: Children<N>, on_key: KeyHandler, on_mouse: MouseHandler ) -> Any

Trait Implementations§

source§

impl<const N: usize> Component for Stack<N>

source§

fn render(&self) -> Any

source§

impl<const N: usize> Default for Stack<N>

source§

fn default() -> Stack<N>

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

Auto Trait Implementations§

§

impl<const N: usize> !RefUnwindSafe for Stack<N>

§

impl<const N: usize> Send for Stack<N>

§

impl<const N: usize> Sync for Stack<N>

§

impl<const N: usize> Unpin for Stack<N>

§

impl<const N: usize> !UnwindSafe for Stack<N>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.