Entity

Struct Entity 

Source
pub struct Entity(/* private fields */);

Implementations§

Source§

impl Entity

Source

pub fn null() -> Entity

Creates a null entity

A null entity can be used as a placeholder within a widget struct but cannot be used to get/set properties

Source

pub fn root() -> Entity

Creates a root entity

The root entity represents the main window and is alwys valid. The root entity can be used to set properties on the window, such as background color, as well as sending events to the window such as Restyle and Redraw events.

Source

pub fn is_null(&self) -> bool

Returns true if the entity is null

Source

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

Returns the index of the entity

Source

pub fn generation(&self) -> Option<u8>

Returns the generation of the entity

Trait Implementations§

Source§

impl AsEntity for Entity

Source§

fn entity(&self) -> Entity

Source§

impl Clone for Entity

Source§

fn clone(&self) -> Entity

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 Entity

Source§

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

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

impl Default for Entity

Source§

fn default() -> Entity

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

impl Display for Entity

Source§

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

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

impl Hash for Entity

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'a> IntoBranchIterator<'a> for &'a Entity

Source§

impl<'a> IntoChildIterator<'a> for &'a Entity

Source§

impl<'a> IntoParentIterator<'a> for &'a Entity

Source§

impl<'a> IntoTreeIterator<'a> for &'a Entity

Source§

impl<'a> Node<'a> for Entity

Source§

type Data = Style

A type representing an external store in case the position and size data is not be owned by the node itself (e.g. ECS)
Source§

fn layout_type(&self, store: &<Entity as Node<'a>>::Data) -> Option<LayoutType>

Get the layout type of the node Read more
Source§

fn position_type( &self, store: &<Entity as Node<'a>>::Data, ) -> Option<PositionType>

Get the position type of the node Read more
Source§

fn left(&self, store: &<Entity as Node<'a>>::Data) -> Option<Units>

Get the desired space to the left of the node in units
Source§

fn min_left(&self, store: &<Entity as Node<'a>>::Data) -> Option<Units>

Get the desired min_left of the node in units
Source§

fn max_left(&self, store: &<Entity as Node<'a>>::Data) -> Option<Units>

Get the desired min_left of the node in units
Source§

fn right(&self, store: &<Entity as Node<'a>>::Data) -> Option<Units>

Get the desired space to the right of the node in units
Source§

fn min_right(&self, store: &<Entity as Node<'a>>::Data) -> Option<Units>

Get the desired min_left of the node in units
Source§

fn max_right(&self, store: &<Entity as Node<'a>>::Data) -> Option<Units>

Get the desired min_left of the node in units
Source§

fn top(&self, store: &<Entity as Node<'a>>::Data) -> Option<Units>

Get the desired space above the node in units
Source§

fn min_top(&self, store: &<Entity as Node<'a>>::Data) -> Option<Units>

Get the desired min_left of the node in units
Source§

fn max_top(&self, store: &<Entity as Node<'a>>::Data) -> Option<Units>

Get the desired min_left of the node in units
Source§

fn bottom(&self, store: &<Entity as Node<'a>>::Data) -> Option<Units>

Get the desired space below the node in units
Source§

fn min_bottom(&self, store: &<Entity as Node<'a>>::Data) -> Option<Units>

Get the desired min_left of the node in units
Source§

fn max_bottom(&self, store: &<Entity as Node<'a>>::Data) -> Option<Units>

Get the desired min_left of the node in units
Source§

fn width(&self, store: &<Entity as Node<'a>>::Data) -> Option<Units>

Get the desired width of the node in units
Source§

fn min_width(&self, store: &<Entity as Node<'a>>::Data) -> Option<Units>

Get the desired min_width of the node in units
Source§

fn max_width(&self, store: &<Entity as Node<'a>>::Data) -> Option<Units>

Get the desired max_width of the node in units
Source§

fn height(&self, store: &<Entity as Node<'a>>::Data) -> Option<Units>

Get the desired height of the node in units
Source§

fn min_height(&self, store: &<Entity as Node<'a>>::Data) -> Option<Units>

Get the desired min_height of the node in units
Source§

fn max_height(&self, store: &<Entity as Node<'a>>::Data) -> Option<Units>

Get the desired max_height of the node in units
Source§

fn child_left(&self, store: &<Entity as Node<'a>>::Data) -> Option<Units>

Get the desired space to the left of all child nodes in units Read more
Source§

fn child_right(&self, store: &<Entity as Node<'a>>::Data) -> Option<Units>

Get the desired space to the right of all child nodes in units Read more
Source§

fn child_top(&self, store: &<Entity as Node<'a>>::Data) -> Option<Units>

Get the desired space above all child nodes in units Read more
Source§

fn child_bottom(&self, store: &<Entity as Node<'a>>::Data) -> Option<Units>

Get the desired space below all child nodes in units Read more
Source§

fn grid_cols(&self, store: &<Entity as Node<'a>>::Data) -> Option<Vec<Units>>

Get the desired grid columns as a vector of units
Source§

fn grid_rows(&self, store: &<Entity as Node<'a>>::Data) -> Option<Vec<Units>>

Get the desired grid rows as a vector of units
Source§

fn row_between(&self, store: &<Entity as Node<'a>>::Data) -> Option<Units>

Get the desired space between children in units when stacked in a column
Source§

fn col_between(&self, store: &<Entity as Node<'a>>::Data) -> Option<Units>

Get the desired space between children in units when stacked in a row
Source§

fn border_left(&self, store: &<Entity as Node<'a>>::Data) -> Option<Units>

Source§

fn border_right(&self, store: &<Entity as Node<'a>>::Data) -> Option<Units>

Source§

fn border_top(&self, store: &<Entity as Node<'a>>::Data) -> Option<Units>

Source§

fn border_bottom(&self, store: &<Entity as Node<'a>>::Data) -> Option<Units>

Source§

fn row_index(&self, store: &<Entity as Node<'a>>::Data) -> Option<usize>

Get the desired row_index of the node in units
Source§

fn row_span(&self, store: &<Entity as Node<'a>>::Data) -> Option<usize>

Source§

fn col_index(&self, store: &<Entity as Node<'a>>::Data) -> Option<usize>

Get the desired col_index of the node in units
Source§

fn col_span(&self, store: &<Entity as Node<'a>>::Data) -> Option<usize>

Source§

impl PartialEq for Entity

Source§

fn eq(&self, other: &Entity) -> 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 PropGet for Entity

Source§

fn is_disabled(self, state: &mut State) -> bool

Source§

fn is_hovered(self, state: &mut State) -> bool

Source§

fn is_selected(self, state: &mut State) -> bool

Source§

fn is_checked(self, state: &mut State) -> bool

Source§

fn is_over(self, state: &mut State) -> bool

Source§

fn is_active(self, state: &mut State) -> bool

Source§

fn is_focused(self, state: &mut State) -> bool

Source§

fn get_overflow(&self, state: &mut State) -> Overflow

Source§

fn get_display(&self, state: &mut State) -> Display

Source§

fn get_left(&self, state: &mut State) -> Units

Source§

fn get_right(&self, state: &mut State) -> Units

Source§

fn get_top(&self, state: &mut State) -> Units

Source§

fn get_bottom(&self, state: &mut State) -> Units

Source§

fn get_width(&self, state: &mut State) -> Units

Source§

fn get_height(&self, state: &mut State) -> Units

Source§

fn get_min_width(&self, state: &mut State) -> Units

Source§

fn get_max_width(&self, state: &mut State) -> Units

Source§

fn get_min_height(&self, state: &mut State) -> Units

Source§

fn get_max_height(&self, state: &mut State) -> Units

Source§

fn get_border_width(&self, state: &mut State) -> Units

Source§

fn get_tooltip(&self, state: &mut State) -> String

Source§

fn get_text(&self, state: &mut State) -> String

Source§

fn get_font(&self, state: &mut State) -> String

Source§

fn name(&self, state: &mut State) -> String

Source§

fn element(&self, state: &mut State) -> String

Source§

fn get_layout_type(&self, state: &mut State) -> LayoutType

Source§

fn get_background_color(&self, state: &mut State) -> Color

Source§

impl TreeExt for Entity

Source§

fn parent(&self, tree: &Tree) -> Option<Entity>

Source§

fn is_sibling(&self, tree: &Tree, entity: Entity) -> bool

Source§

fn is_child_of(&self, tree: &Tree, entity: Entity) -> bool

Source§

fn is_descendant_of(&self, tree: &Tree, entity: Entity) -> bool

Source§

impl Copy for Entity

Source§

impl Eq for Entity

Source§

impl StructuralPartialEq for Entity

Auto Trait Implementations§

§

impl Freeze for Entity

§

impl RefUnwindSafe for Entity

§

impl Send for Entity

§

impl Sync for Entity

§

impl Unpin for Entity

§

impl UnwindSafe for Entity

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> 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<S> Message for S
where S: 'static + PartialEq,

Source§

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

Source§

fn equals_a(&self, other: &(dyn Message + 'static)) -> bool

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> PropSet for T
where T: AsEntity,

Source§

fn emit(&self, state: &mut State, message: impl Message) -> Entity
where Self: 'static,

Helper method for sending an event to self with default propagation
Source§

fn emit_to( &self, state: &mut State, target: Entity, message: impl Message, ) -> Entity

Helper method for sending an event to target with default propagation
Source§

fn add_listener<F, W>(&self, state: &mut State, listener: F) -> Entity
where W: Widget, F: 'static + Fn(&mut W, &mut State, Entity, &mut Event),

Source§

fn set_name(self, state: &mut State, name: &str) -> Entity

Source§

fn class(self, state: &mut State, class_name: &str) -> Entity

Add a class name to an entity
Source§

fn get_parent(self, state: &mut State) -> Option<Entity>

Source§

fn set_disabled(self, state: &mut State, value: bool) -> Entity

Source§

fn set_checked(self, state: &mut State, value: bool) -> Entity

Source§

fn set_over(self, state: &mut State, value: bool) -> Entity

Source§

fn set_active(self, state: &mut State, value: bool) -> Entity

Source§

fn set_hover(self, state: &mut State, value: bool) -> Entity

Source§

fn set_focus(self, state: &mut State, value: bool) -> Entity

Source§

fn set_element(self, state: &mut State, value: &str) -> Entity

Source§

fn set_id(self, state: &mut State, value: &str) -> Entity

Source§

fn set_visibility(self, state: &mut State, value: Visibility) -> Entity

Source§

fn set_hoverable(self, state: &mut State, value: bool) -> Entity

Source§

fn set_focusable(self, state: &mut State, value: bool) -> Entity

Source§

fn set_overflow(self, state: &mut State, value: Overflow) -> Entity

Source§

fn set_display(self, state: &mut State, value: Display) -> Entity

Source§

fn set_opacity(self, state: &mut State, value: f32) -> Entity

Source§

fn set_rotate(self, state: &mut State, value: f32) -> Entity

Source§

fn set_translate(self, state: &mut State, value: (f32, f32)) -> Entity

Source§

fn set_scale(self, state: &mut State, value: f32) -> Entity

Source§

fn set_position_type(self, state: &mut State, value: PositionType) -> Entity

Source§

fn set_space(self, state: &mut State, value: Units) -> Entity

Source§

fn set_left(self, state: &mut State, value: Units) -> Entity

Source§

fn set_right(self, state: &mut State, value: Units) -> Entity

Source§

fn set_top(self, state: &mut State, value: Units) -> Entity

Source§

fn set_bottom(self, state: &mut State, value: Units) -> Entity

Source§

fn set_min_left(self, state: &mut State, value: Units) -> Entity

Source§

fn set_max_left(self, state: &mut State, value: Units) -> Entity

Source§

fn set_min_right(self, state: &mut State, value: Units) -> Entity

Source§

fn set_max_right(self, state: &mut State, value: Units) -> Entity

Source§

fn set_min_top(self, state: &mut State, value: Units) -> Entity

Source§

fn set_max_top(self, state: &mut State, value: Units) -> Entity

Source§

fn set_min_bottom(self, state: &mut State, value: Units) -> Entity

Source§

fn set_max_bottom(self, state: &mut State, value: Units) -> Entity

Source§

fn set_width(self, state: &mut State, value: Units) -> Entity

Source§

fn set_height(self, state: &mut State, value: Units) -> Entity

Source§

fn set_min_width(self, state: &mut State, value: Units) -> Entity

Source§

fn set_max_width(self, state: &mut State, value: Units) -> Entity

Source§

fn set_min_height(self, state: &mut State, value: Units) -> Entity

Source§

fn set_max_height(self, state: &mut State, value: Units) -> Entity

Source§

fn set_text(self, state: &mut State, text: &str) -> Entity

Source§

fn set_font(self, state: &mut State, font: &str) -> Entity

Source§

fn set_font_size(self, state: &mut State, value: f32) -> Entity

Source§

fn set_color(self, state: &mut State, value: Color) -> Entity

Source§

fn set_tooltip(self, state: &mut State, text: &str) -> Entity

Source§

fn set_background_color(self, state: &mut State, value: Color) -> Entity

Source§

fn set_background_image(self, state: &mut State, value: Rc<()>) -> Entity

Source§

fn set_border_width(self, state: &mut State, value: Units) -> Entity

Source§

fn set_border_color(self, state: &mut State, value: Color) -> Entity

Source§

fn set_border_corner_shape( self, state: &mut State, value: BorderCornerShape, ) -> Entity

Source§

fn set_border_top_left_shape( self, state: &mut State, value: BorderCornerShape, ) -> Entity

Source§

fn set_border_top_right_shape( self, state: &mut State, value: BorderCornerShape, ) -> Entity

Source§

fn set_border_bottom_left_shape( self, state: &mut State, value: BorderCornerShape, ) -> Entity

Source§

fn set_border_bottom_right_shape( self, state: &mut State, value: BorderCornerShape, ) -> Entity

Source§

fn set_border_radius(self, state: &mut State, value: Units) -> Entity

Source§

fn set_border_radius_top_left(self, state: &mut State, value: Units) -> Entity

Source§

fn set_border_radius_top_right(self, state: &mut State, value: Units) -> Entity

Source§

fn set_border_radius_bottom_left( self, state: &mut State, value: Units, ) -> Entity

Source§

fn set_border_radius_bottom_right( self, state: &mut State, value: Units, ) -> Entity

Source§

fn set_outer_shadow_h_offset(self, state: &mut State, value: Units) -> Self

Source§

fn set_outer_shadow_v_offset(self, state: &mut State, value: Units) -> Self

Source§

fn set_outer_shadow_color(self, state: &mut State, value: Color) -> Self

Source§

fn set_outer_shadow_blur(self, state: &mut State, value: Units) -> Self

Source§

fn set_clip_widget(self, state: &mut State, value: Entity) -> Entity

Source§

fn set_z_order(self, state: &mut State, value: i32) -> Entity

Source§

fn set_next_focus(self, state: &mut State, value: Entity) -> Entity

Source§

fn set_prev_focus(self, state: &mut State, value: Entity) -> Entity

Source§

fn set_focus_order( self, state: &mut State, prev: Entity, next: Entity, ) -> Entity

Source§

fn set_layout_type(&self, state: &mut State, value: LayoutType) -> Entity

Source§

fn set_child_space(&self, state: &mut State, value: Units) -> Entity

Source§

fn set_child_left(&self, state: &mut State, value: Units) -> Entity

Source§

fn set_row_between(&self, state: &mut State, value: Units) -> Entity

Source§

fn set_col_between(&self, state: &mut State, value: Units) -> Entity

Source§

fn set_child_right(&self, state: &mut State, value: Units) -> Entity

Source§

fn set_child_top(&self, state: &mut State, value: Units) -> Entity

Source§

fn set_child_bottom(&self, state: &mut State, value: Units) -> Entity

Source§

fn set_grid_rows(&self, state: &mut State, value: Vec<Units>) -> Entity

Source§

fn set_grid_cols(&self, state: &mut State, value: Vec<Units>) -> Entity

Source§

fn set_row_index(&self, state: &mut State, value: usize) -> Entity

Source§

fn set_col_index(&self, state: &mut State, value: usize) -> Entity

Source§

fn set_row_span(&self, state: &mut State, value: usize) -> Entity

Source§

fn set_col_span(self, state: &mut State, value: usize) -> Self

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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,