Trait View

Source
pub trait View:
    Bundle
    + Debug
    + Clone
    + Default {
    // Required methods
    fn name_node(&mut self) -> &mut Name;
    fn node_node(&mut self) -> &mut Node;

    // Provided methods
    fn new() -> Self { ... }
    fn from_name(name: impl Into<Cow<'static, str>>) -> Self { ... }
    fn name(self, name: impl Into<Cow<'static, str>>) -> Self { ... }
    fn padding(self, padding: UiRect) -> Self { ... }
    fn frame(self, width: Val, height: Val) -> Self { ... }
    fn width(self, width: Val) -> Self { ... }
    fn height(self, height: Val) -> Self { ... }
}
Expand description

Provides common builder-style methods for UI configuration

Required Methods§

Source

fn name_node(&mut self) -> &mut Name

Returns a mutable reference to the entity’s Name component

Source

fn node_node(&mut self) -> &mut Node

Returns a mutable reference to the entity’s Node component

Provided Methods§

Source

fn new() -> Self

Short Default Method

Source

fn from_name(name: impl Into<Cow<'static, str>>) -> Self

Source

fn name(self, name: impl Into<Cow<'static, str>>) -> Self

Sets the Name component

Source

fn padding(self, padding: UiRect) -> Self

Applies padding to the Node

Source

fn frame(self, width: Val, height: Val) -> Self

Sets width and height of the Node

Source

fn width(self, width: Val) -> Self

Sets the width of the Node

Source

fn height(self, height: Val) -> Self

Sets the height of the Node

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§