Hbox

Struct Hbox 

Source
pub struct Hbox {
    pub widgets: Vec<Option<Widget>>,
    pub shape: Rect,
    /* private fields */
}

Fields§

§widgets: Vec<Option<Widget>>

Widgets

§shape: Rect

Widget shape.

Implementations§

Source§

impl Hbox

Source

pub fn new(widgets: Vec<Option<Widget>>) -> Self

Source

pub fn id(&self) -> Option<usize>

Source

pub fn set_id(self, id: usize) -> Self

Source

pub fn is_wrap(&self) -> bool

Check if Widget’s wrap around.

Source

pub fn wrap()

Wrap around

Source

pub fn render(&mut self, rect: Rect)

Render the widget on console.

Trait Implementations§

Source§

impl AsWidget for Hbox

Source§

fn as_widget(self) -> Option<Widget>

Convert T => Option<Widget> Read more
Source§

impl EventHandler for Hbox

Source§

fn start(&mut self)

Start rendering the Widgets on screen. [ Infinity loop ] Read more
Source§

fn handle_event(&mut self)

Handle inputs. Read more
Source§

fn trigger_callback(&mut self, clicked_widget: Option<Widget>) -> Option<Widget>

Trigger the callback on_click. Read more

Auto Trait Implementations§

§

impl Freeze for Hbox

§

impl !RefUnwindSafe for Hbox

§

impl !Send for Hbox

§

impl !Sync for Hbox

§

impl Unpin for Hbox

§

impl !UnwindSafe for Hbox

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