Struct Stack

Source
pub struct Stack<State, Delegate> { /* private fields */ }
Expand description

A stack can be used to place multiple items after each other, e.g. horizontally, or vertically.

Implementations§

Source§

impl<State, Delegate> Stack<State, Delegate>

Source

pub fn new(direction: StackDirection) -> Self

A stack can be used to place multiple items after each other, e.g. horizontally, or vertically.

Source

pub fn horizontal() -> Self

Align the items horizontally, i.e. left to right. This is the same as:

Stack::new(StackDirection::Horizontal);
Source

pub fn vertical() -> Self

Align the items horizontally, i.e. top to bottom. This is the same as:

Stack::new(StackDirection::Vertical);
Source§

impl<State: 'static, Delegate> Stack<State, Delegate>
where Delegate: AppDelegate<State> + 'static,

Source

pub fn with(self, view: impl Into<Box<dyn View<Delegate, State>>>) -> Self

Append a view to the stack.

Trait Implementations§

Source§

impl<Delegate, State> From<Stack<State, Delegate>> for Box<dyn View<Delegate, State>>
where Delegate: AppDelegate<State> + 'static, State: 'static,

Source§

fn from(value: Stack<State, Delegate>) -> Self

Converts to this type from the input type.
Source§

impl<Delegate, State> View<Delegate, State> for Stack<State, Delegate>
where Delegate: 'static + AppDelegate<State>, State: 'static,

Auto Trait Implementations§

§

impl<State, Delegate> Freeze for Stack<State, Delegate>

§

impl<State, Delegate> !RefUnwindSafe for Stack<State, Delegate>

§

impl<State, Delegate> !Send for Stack<State, Delegate>

§

impl<State, Delegate> !Sync for Stack<State, Delegate>

§

impl<State, Delegate> Unpin for Stack<State, Delegate>
where Delegate: Unpin,

§

impl<State, Delegate> !UnwindSafe for Stack<State, Delegate>

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> BaseViewExt for T
where T: BaseView,

Source§

fn set_tooltip(&mut self, tooltip: impl Into<StateOrRaw<String>>)

Set the tooltip of the view, which is text that is commonly displayed when hovering over a component (such as a button). This is used to provide the user with more context, or to let them know what the action will do.
Source§

fn with_tooltip(self, tooltip: impl Into<StateOrRaw<String>>) -> T

Set the tooltip of the view, which is text that is commonly displayed when hovering over a component (such as a button). This is used to provide the user with more context, or to let them know what the action will do.
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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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