pub struct Node {
pub id: String,
pub label: String,
pub kind: Kind,
pub style: Style,
pub enabled: bool,
pub children: Vec<Node>,
}Expand description
Declarative widget tree; retained interaction state lives in Ui, keyed by id.
Fields§
§id: String§label: String§kind: Kind§style: Style§enabled: bool§children: Vec<Node>Implementations§
Source§impl Node
impl Node
pub fn column(id: impl Into<String>, children: Vec<Self>) -> Self
pub fn row(id: impl Into<String>, children: Vec<Self>) -> Self
Sourcepub fn scroll(id: impl Into<String>, children: Vec<Self>) -> Self
pub fn scroll(id: impl Into<String>, children: Vec<Self>) -> Self
Vertical scrolling viewport. Give it a fixed height or fill_height.
pub fn label(id: impl Into<String>, text: impl Into<String>) -> Self
pub fn toggle( id: impl Into<String>, label: impl Into<String>, checked: bool, ) -> Self
Sourcepub fn slider(
id: impl Into<String>,
label: impl Into<String>,
value: f32,
min: f32,
max: f32,
step: f32,
) -> Self
pub fn slider( id: impl Into<String>, label: impl Into<String>, value: f32, min: f32, max: f32, step: f32, ) -> Self
Invalid ranges/values are rejected by Ui::set_root, not silently accepted.
pub fn text_input( id: impl Into<String>, label: impl Into<String>, value: impl Into<String>, placeholder: impl Into<String>, ) -> Self
pub fn custom( id: impl Into<String>, label: impl Into<String>, interactive: bool, paint: impl Fn(&mut Painter, Rect, &Theme) + Send + Sync + 'static, ) -> Self
pub fn width(self, px: f32) -> Self
pub fn height(self, px: f32) -> Self
pub fn auto_width(self) -> Self
pub fn fill_height(self) -> Self
pub fn padding(self, px: f32) -> Self
pub fn gap(self, px: f32) -> Self
pub fn background(self, color: Color) -> Self
pub fn color(self, color: Color) -> Self
pub fn border(self) -> Self
pub fn radius(self, px: f32) -> Self
pub fn font_size(self, px: f32) -> Self
pub fn bold(self) -> Self
pub fn disabled(self) -> Self
pub fn focusable(&self) -> bool
pub fn role(&self) -> &'static str
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Node
impl !UnwindSafe for Node
impl Freeze for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnsafeUnpin for Node
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more