Skip to main content

ComponentNode

Struct ComponentNode 

Source
pub struct ComponentNode {
    pub key: String,
    pub component: Component,
    pub action: Option<Action>,
    pub visibility: Option<Visibility>,
}
Expand description

A component node wrapping a component with shared fields.

Every component in a view tree is wrapped in a ComponentNode that provides a unique key, optional action binding, and optional visibility rules. The component itself is flattened into the node’s JSON.

Fields§

§key: String§component: Component§action: Option<Action>§visibility: Option<Visibility>

Implementations§

Source§

impl ComponentNode

Source

pub fn card(key: impl Into<String>, props: CardProps) -> Self

Create a Card component node.

Source

pub fn table(key: impl Into<String>, props: TableProps) -> Self

Create a Table component node.

Source

pub fn form(key: impl Into<String>, props: FormProps) -> Self

Create a Form component node.

Source

pub fn button(key: impl Into<String>, props: ButtonProps) -> Self

Create a Button component node.

Source

pub fn input(key: impl Into<String>, props: InputProps) -> Self

Create an Input component node.

Source

pub fn select(key: impl Into<String>, props: SelectProps) -> Self

Create a Select component node.

Source

pub fn alert(key: impl Into<String>, props: AlertProps) -> Self

Create an Alert component node.

Source

pub fn badge(key: impl Into<String>, props: BadgeProps) -> Self

Create a Badge component node.

Source

pub fn modal(key: impl Into<String>, props: ModalProps) -> Self

Create a Modal component node.

Source

pub fn text(key: impl Into<String>, props: TextProps) -> Self

Create a Text component node.

Source

pub fn checkbox(key: impl Into<String>, props: CheckboxProps) -> Self

Create a Checkbox component node.

Source

pub fn switch(key: impl Into<String>, props: SwitchProps) -> Self

Create a Switch component node.

Source

pub fn separator(key: impl Into<String>, props: SeparatorProps) -> Self

Create a Separator component node.

Source

pub fn description_list( key: impl Into<String>, props: DescriptionListProps, ) -> Self

Create a DescriptionList component node.

Source

pub fn tabs(key: impl Into<String>, props: TabsProps) -> Self

Create a Tabs component node.

Source

pub fn breadcrumb(key: impl Into<String>, props: BreadcrumbProps) -> Self

Create a Breadcrumb component node.

Source

pub fn pagination(key: impl Into<String>, props: PaginationProps) -> Self

Create a Pagination component node.

Source

pub fn progress(key: impl Into<String>, props: ProgressProps) -> Self

Create a Progress component node.

Source

pub fn avatar(key: impl Into<String>, props: AvatarProps) -> Self

Create an Avatar component node.

Source

pub fn skeleton(key: impl Into<String>, props: SkeletonProps) -> Self

Create a Skeleton component node.

Source

pub fn stat_card(key: impl Into<String>, props: StatCardProps) -> Self

Create a StatCard component node.

Source

pub fn checklist(key: impl Into<String>, props: ChecklistProps) -> Self

Create a Checklist component node.

Source

pub fn toast(key: impl Into<String>, props: ToastProps) -> Self

Create a Toast component node.

Source

pub fn notification_dropdown( key: impl Into<String>, props: NotificationDropdownProps, ) -> Self

Create a NotificationDropdown component node.

Source

pub fn sidebar(key: impl Into<String>, props: SidebarProps) -> Self

Create a Sidebar component node.

Source

pub fn header(key: impl Into<String>, props: HeaderProps) -> Self

Create a Header component node.

Source

pub fn grid(key: impl Into<String>, props: GridProps) -> Self

Create a Grid component node.

Source

pub fn collapsible(key: impl Into<String>, props: CollapsibleProps) -> Self

Create a Collapsible component node.

Source

pub fn empty_state(key: impl Into<String>, props: EmptyStateProps) -> Self

Create an EmptyState component node.

Source

pub fn form_section(key: impl Into<String>, props: FormSectionProps) -> Self

Create a FormSection component node.

Source

pub fn dropdown_menu(key: impl Into<String>, props: DropdownMenuProps) -> Self

Create a DropdownMenu component node.

Source

pub fn kanban_board(key: impl Into<String>, props: KanbanBoardProps) -> Self

Create a KanbanBoard component node.

Source

pub fn calendar_cell(key: impl Into<String>, props: CalendarCellProps) -> Self

Create a CalendarCell component node.

Source

pub fn action_card(key: impl Into<String>, props: ActionCardProps) -> Self

Create an ActionCard component node.

Source

pub fn product_tile(key: impl Into<String>, props: ProductTileProps) -> Self

Create a ProductTile component node.

Source

pub fn data_table(key: impl Into<String>, props: DataTableProps) -> Self

Create a DataTable component node.

Source

pub fn image(key: impl Into<String>, props: ImageProps) -> Self

Create an Image component node.

Source

pub fn plugin_component(key: impl Into<String>, props: PluginProps) -> Self

Create a Plugin component node.

Use plugin_component to avoid ambiguity with any plugin module.

Trait Implementations§

Source§

impl Clone for ComponentNode

Source§

fn clone(&self) -> ComponentNode

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 ComponentNode

Source§

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

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

impl<'de> Deserialize<'de> for ComponentNode

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ComponentNode

Source§

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

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ComponentNode

Auto Trait Implementations§

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> 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, 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,