pub enum ViewKind<A> {
Empty,
Widget(Rc<dyn Widget<A>>),
Component(Rc<dyn ComponentNode<A>>),
}Expand description
Discriminant of a View node.
Widget and component variants share their implementation through a
UI-thread-local Rc; cloning a kind does not clone the underlying object.
§Examples
use ailloli_ui_runtime::component::ViewKind;
let kind: ViewKind<()> = ViewKind::Empty;
assert!(matches!(kind, ViewKind::Empty));Variants§
Empty
Placeholder with no content.
Widget(Rc<dyn Widget<A>>)
Built-in or custom widget implementing Widget.
Component(Rc<dyn ComponentNode<A>>)
Stateful component with a render function.
Trait Implementations§
Auto Trait Implementations§
impl<A> Freeze for ViewKind<A>
impl<A> !RefUnwindSafe for ViewKind<A>
impl<A> !Send for ViewKind<A>
impl<A> !Sync for ViewKind<A>
impl<A> Unpin for ViewKind<A>
impl<A> !UnwindSafe for ViewKind<A>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
Source§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.