Skip to content

struct

Part

pub struct Part {
    pub name: &'static str,
    pub summary: &'static str,
    pub props: &'static [Prop],
    pub events: &'static [(&'static str, &'static str)],
    pub children: bool,
}

One component of a family (CardTitle in the Card family).

Fields

name

pub name: &'static str

The component's name.

summary

pub summary: &'static str

What it is, in a sentence or two.

props

pub props: &'static [Prop]

The props it reads.

events

pub events: &'static [(&'static str, &'static str)]

(event, when it fires) — component events; DOM events such as click are forwarded to the part's element too.

children

pub children: bool

Whether it takes content.

Methods

prop

pub fn prop(&self, name: &str) -> Option<&'static Prop>

A prop it documents or shares with others like it (not counting COMMON ones).

is_chart

pub fn is_chart(&self) -> bool

Whether it's drawn by the shared chart frame.

reads_source

pub fn reads_source(&self) -> bool

Whether it reads a data source.

shared_props

pub fn shared_props(&self) -> impl Iterator<Item = &'static Prop> + use<>

The shared props it takes beyond its own.

all_events

pub fn all_events(&self) -> impl Iterator<Item = &'static (&'static str, &'static str)> + use<>

Its own events and the ones it shares with others like it.

accepts

pub fn accepts(&self, name: &str) -> bool

Whether name is accepted: documented, common, or a plain attribute that's forwarded.

Trait implementations