pub struct ComponentFile {
pub components: HashMap<String, ComponentDef>,
}Expand description
Parsed multi-component .crepus file.
A multi-component file starts with an optional +++...+++ TOML frontmatter
block, followed by one or more component sections introduced by --- Name.
+++
[Card]
description = "A simple card"
[Card.defaults]
title = "Untitled"
subtitle = ""
[Button]
description = "A clickable button"
[Button.defaults]
label = "Click me"
variant = "primary"
+++
--- Card
div rounded-lg border p-4 mb-2
div font-bold text-lg
{title}
div text-sm text-gray-400
{subtitle}
slot
--- Button
$: default variant = "primary"
button px-4 py-2 rounded
{label}Components are then included with include components.crepus#Card title="Hello".
Fields§
§components: HashMap<String, ComponentDef>Auto Trait Implementations§
impl Freeze for ComponentFile
impl RefUnwindSafe for ComponentFile
impl Send for ComponentFile
impl Sync for ComponentFile
impl Unpin for ComponentFile
impl UnsafeUnpin for ComponentFile
impl UnwindSafe for ComponentFile
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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