Builder

Struct Builder 

Source
pub struct Builder<'a, T> {
    pub entity: Entity,
    pub state: &'a mut State,
    /* private fields */
}
Expand description

Contains an entity id and a mutable reference to state and can be used to set properties of a widget at build time

Fields§

§entity: Entity§state: &'a mut State

Implementations§

Source§

impl<'a, T> Builder<'a, T>

Source

pub fn state(&mut self) -> &mut State

Returns a mutable reference to the State

Source

pub fn entity(&self) -> Entity

Returns the entity id contained within the builder

Source

pub fn on_press<F>(self, handler: F) -> Builder<'a, T>
where T: Widget, F: FnMut(&mut T, &mut State, Entity) + 'static,

Sets the general callback for pressing a widget

Source

pub fn class(self, class_name: &str) -> Builder<'a, T>

Adds a class name to the entity

Source

pub fn set_name(self, name: &str) -> Builder<'a, T>

Source

pub fn set_element(self, element: &str) -> Builder<'a, T>

Sets the element name of the entity

Source

pub fn set_id(self, id: &str) -> Builder<'a, T>

Sets the id of the entity

Source

pub fn set_disabled(self, value: bool) -> Builder<'a, T>

Source

pub fn set_hoverable(self, value: bool) -> Builder<'a, T>

Sets whether the entity can be hovered

Source

pub fn set_focusable(self, value: bool) -> Builder<'a, T>

Sets whether the entity can be focused

Source

pub fn set_opacity(self, value: f32) -> Builder<'a, T>

Sets the opacity of the entity

Source

pub fn set_checked(self, value: bool) -> Builder<'a, T>

Sets the checked state of the entity

Source

pub fn set_z_order(self, value: i32) -> Builder<'a, T>

Sets the z-order of the entity

Source

pub fn set_clip_widget(self, value: Entity) -> Builder<'a, T>

Sets the clip widget of the entity. The clip bounds of the entity are set to the bounds of the clip widget

Source

pub fn set_text(self, value: &str) -> Builder<'a, T>

Source

pub fn set_font(self, value: &str) -> Builder<'a, T>

Source

pub fn set_tooltip(self, value: &str) -> Builder<'a, T>

Source

pub fn set_display(self, value: Display) -> Builder<'a, T>

Sets the display type of the entity

Source

pub fn set_visibility(self, value: Visibility) -> Builder<'a, T>

Source

pub fn set_overflow(self, value: Overflow) -> Builder<'a, T>

Source

pub fn set_background_color(self, value: Color) -> Builder<'a, T>

Source

pub fn set_background_image(self, value: Rc<()>) -> Builder<'a, T>

Source

pub fn set_background_gradient(self, value: LinearGradient) -> Builder<'a, T>

Source

pub fn set_outer_shadow_h_offset(self, value: Units) -> Builder<'a, T>

Source

pub fn set_outer_shadow_v_offset(self, value: Units) -> Builder<'a, T>

Source

pub fn set_outer_shadow_color(self, value: Color) -> Builder<'a, T>

Source

pub fn set_outer_shadow_blur(self, value: Units) -> Builder<'a, T>

Source

pub fn set_inner_shadow_h_offset(self, value: Units) -> Builder<'a, T>

Source

pub fn set_inner_shadow_v_offset(self, value: Units) -> Builder<'a, T>

Source

pub fn set_inner_shadow_color(self, value: Color) -> Builder<'a, T>

Source

pub fn set_inner_shadow_blur(self, value: Units) -> Builder<'a, T>

Source

pub fn set_space(self, value: Units) -> Builder<'a, T>

Source

pub fn set_left(self, value: Units) -> Builder<'a, T>

Source

pub fn set_right(self, value: Units) -> Builder<'a, T>

Source

pub fn set_top(self, value: Units) -> Builder<'a, T>

Source

pub fn set_bottom(self, value: Units) -> Builder<'a, T>

Source

pub fn set_width(self, value: Units) -> Builder<'a, T>

Source

pub fn set_height(self, value: Units) -> Builder<'a, T>

Source

pub fn set_min_width(self, value: Units) -> Builder<'a, T>

Source

pub fn set_max_width(self, value: Units) -> Builder<'a, T>

Source

pub fn set_min_height(self, value: Units) -> Builder<'a, T>

Source

pub fn set_max_height(self, value: Units) -> Builder<'a, T>

Source

pub fn set_min_left(self, value: Units) -> Builder<'a, T>

Source

pub fn set_min_right(self, value: Units) -> Builder<'a, T>

Source

pub fn set_min_top(self, value: Units) -> Builder<'a, T>

Source

pub fn set_min_bottom(self, value: Units) -> Builder<'a, T>

Source

pub fn set_max_left(self, value: Units) -> Builder<'a, T>

Source

pub fn set_max_right(self, value: Units) -> Builder<'a, T>

Source

pub fn set_max_top(self, value: Units) -> Builder<'a, T>

Source

pub fn set_max_bottom(self, value: Units) -> Builder<'a, T>

Source

pub fn set_border_color(self, value: Color) -> Builder<'a, T>

Source

pub fn set_border_width(self, value: Units) -> Builder<'a, T>

Source

pub fn set_border_corner_shape(self, value: BorderCornerShape) -> Builder<'a, T>

Source

pub fn set_border_top_left_shape( self, value: BorderCornerShape, ) -> Builder<'a, T>

Source

pub fn set_border_top_right_shape( self, value: BorderCornerShape, ) -> Builder<'a, T>

Source

pub fn set_border_bottom_left_shape( self, value: BorderCornerShape, ) -> Builder<'a, T>

Source

pub fn set_border_bottom_right_shape( self, value: BorderCornerShape, ) -> Builder<'a, T>

Source

pub fn set_border_radius(self, value: Units) -> Builder<'a, T>

Source

pub fn set_border_radius_top_left(self, value: Units) -> Builder<'a, T>

Source

pub fn set_border_radius_top_right(self, value: Units) -> Builder<'a, T>

Source

pub fn set_border_radius_bottom_left(self, value: Units) -> Builder<'a, T>

Source

pub fn set_border_radius_bottom_right(self, value: Units) -> Builder<'a, T>

Source

pub fn set_color(self, value: Color) -> Builder<'a, T>

Source

pub fn set_font_size(self, value: f32) -> Builder<'a, T>

Source

pub fn set_next_focus(self, value: Entity) -> Builder<'a, T>

Source

pub fn set_prev_focus(self, value: Entity) -> Builder<'a, T>

Source

pub fn set_focus(self, next: Entity, prev: Entity) -> Builder<'a, T>

Source

pub fn set_rotate(self, rotate: f32) -> Builder<'a, T>

Source

pub fn set_scale(self, scale: f32) -> Builder<'a, T>

Source

pub fn set_child_left(self, value: Units) -> Builder<'a, T>

Source

pub fn set_child_right(self, value: Units) -> Builder<'a, T>

Source

pub fn set_child_top(self, value: Units) -> Builder<'a, T>

Source

pub fn set_child_bottom(self, value: Units) -> Builder<'a, T>

Source

pub fn set_row_between(self, value: Units) -> Builder<'a, T>

Source

pub fn set_col_between(self, value: Units) -> Builder<'a, T>

Source

pub fn set_child_space(self, value: Units) -> Builder<'a, T>

Source

pub fn set_position_type(self, value: PositionType) -> Builder<'a, T>

Source

pub fn set_layout_type(self, value: LayoutType) -> Builder<'a, T>

Source

pub fn set_row_index(self, value: usize) -> Builder<'a, T>

Source

pub fn set_col_index(self, value: usize) -> Builder<'a, T>

Source

pub fn set_row_span(self, value: usize) -> Builder<'a, T>

Source

pub fn set_col_span(self, value: usize) -> Builder<'a, T>

Source

pub fn set_grid_rows(self, value: Vec<Units>) -> Builder<'a, T>

Source

pub fn set_grid_cols(self, value: Vec<Units>) -> Builder<'a, T>

Auto Trait Implementations§

§

impl<'a, T> Freeze for Builder<'a, T>

§

impl<'a, T> !RefUnwindSafe for Builder<'a, T>

§

impl<'a, T> !Send for Builder<'a, T>

§

impl<'a, T> !Sync for Builder<'a, T>

§

impl<'a, T> Unpin for Builder<'a, T>
where T: Unpin,

§

impl<'a, T> !UnwindSafe for Builder<'a, T>

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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> Node for T
where T: 'static,