pub struct ComponentDef<'a> {
pub kind: ComponentKind<'a>,
pub name: Symbol,
pub props: Vec<(Symbol, &'a TypeExpr<'a>)>,
pub uses: Vec<Symbol>,
pub state: Vec<StateField<'a>>,
pub events: Vec<EventHandler<'a>>,
pub actions: Vec<ActionDef<'a>>,
pub view: Option<ViewDef<'a>>,
pub head: Option<ViewDef<'a>>,
pub style: Option<StyleBlock>,
pub span: Span,
}Expand description
One ## Page / ## Component / ## Store / ## Error page definition.
Fields§
§kind: ComponentKind<'a>§name: Symbol§props: Vec<(Symbol, &'a TypeExpr<'a>)>Header parameters — a component’s props (## Component Row (todo: Todo)), read-only
inside it. A page’s typed path parameters live in its kind.
uses: Vec<Symbol>Use Session. — the stores this component reads and calls.
state: Vec<StateField<'a>>§events: Vec<EventHandler<'a>>§actions: Vec<ActionDef<'a>>§view: Option<ViewDef<'a>>§head: Option<ViewDef<'a>>Head: — the head HTML this page declares for its own document: its title,
description, social card, canonical URL. Rendered at BUILD time into the
document the server sends, and merged over the default shell tag by tag, so
a page that declares nothing keeps the document it has today.
Only a ## Page can carry one: a component is placed INSIDE a document and
does not own it, and two components on one page declaring a title would make
the answer depend on render order.
style: Option<StyleBlock>§span: SpanImplementations§
Trait Implementations§
Source§impl<'a> Clone for ComponentDef<'a>
impl<'a> Clone for ComponentDef<'a>
Source§fn clone(&self) -> ComponentDef<'a>
fn clone(&self) -> ComponentDef<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for ComponentDef<'a>
impl<'a> RefUnwindSafe for ComponentDef<'a>
impl<'a> Send for ComponentDef<'a>
impl<'a> Sync for ComponentDef<'a>
impl<'a> Unpin for ComponentDef<'a>
impl<'a> UnsafeUnpin for ComponentDef<'a>
impl<'a> UnwindSafe for ComponentDef<'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