Skip to main content

Block

Enum Block 

Source
pub enum Block {
Show 21 variants Unknown { name: String, attrs: Attrs, content: String, span: Span, }, Markdown { content: String, span: Span, }, Callout { callout_type: CalloutType, title: Option<String>, content: String, span: Span, }, Data { id: Option<String>, format: DataFormat, sortable: bool, headers: Vec<String>, rows: Vec<Vec<String>>, raw_content: String, span: Span, }, Code { lang: Option<String>, file: Option<String>, highlight: Vec<String>, content: String, span: Span, }, Tasks { items: Vec<TaskItem>, span: Span, }, Decision { status: DecisionStatus, date: Option<String>, deciders: Vec<String>, content: String, span: Span, }, Metric { label: String, value: String, trend: Option<Trend>, unit: Option<String>, span: Span, }, Summary { content: String, span: Span, }, Figure { src: String, caption: Option<String>, alt: Option<String>, width: Option<String>, span: Span, }, Tabs { tabs: Vec<TabPanel>, span: Span, }, Columns { columns: Vec<ColumnContent>, span: Span, }, Quote { content: String, attribution: Option<String>, cite: Option<String>, span: Span, }, Cta { label: String, href: String, primary: bool, span: Span, }, HeroImage { src: String, alt: Option<String>, span: Span, }, Testimonial { content: String, author: Option<String>, role: Option<String>, company: Option<String>, span: Span, }, Style { properties: Vec<StyleProperty>, span: Span, }, Faq { items: Vec<FaqItem>, span: Span, }, PricingTable { headers: Vec<String>, rows: Vec<Vec<String>>, span: Span, }, Site { domain: Option<String>, properties: Vec<StyleProperty>, span: Span, }, Page { route: String, layout: Option<String>, title: Option<String>, sidebar: bool, content: String, children: Vec<Block>, span: Span, },
}
Expand description

A parsed block in the document body.

Variants§

§

Unknown

A block directive that has not yet been typed (Chunk 1 catch-all).

Fields

§name: String
§attrs: Attrs
§content: String
§span: Span
§

Markdown

Plain markdown content between directives.

Fields

§content: String
§span: Span
§

Callout

Callout/admonition box.

Fields

§callout_type: CalloutType
§content: String
§span: Span
§

Data

Structured data table (CSV/JSON/inline rows).

Fields

§format: DataFormat
§sortable: bool
§headers: Vec<String>
§rows: Vec<Vec<String>>
§raw_content: String
§span: Span
§

Code

Code block with optional language and file path.

Fields

§highlight: Vec<String>
§content: String
§span: Span
§

Tasks

Task list with checkbox items.

Fields

§items: Vec<TaskItem>
§span: Span
§

Decision

Decision record.

Fields

§deciders: Vec<String>
§content: String
§span: Span
§

Metric

Single metric display.

Fields

§label: String
§value: String
§trend: Option<Trend>
§span: Span
§

Summary

Executive summary block.

Fields

§content: String
§span: Span
§

Figure

Figure with image source and caption.

Fields

§caption: Option<String>
§span: Span
§

Tabs

Tabbed content with named panels.

Fields

§span: Span
§

Columns

Multi-column layout.

Fields

§span: Span
§

Quote

Attributed quote with optional source.

Fields

§content: String
§attribution: Option<String>
§span: Span
§

Cta

Call-to-action button.

Fields

§label: String
§href: String
§primary: bool
§span: Span
§

HeroImage

Hero image visual.

Fields

§span: Span
§

Testimonial

Customer testimonial.

Fields

§content: String
§author: Option<String>
§company: Option<String>
§span: Span
§

Style

Presentation style overrides (key-value pairs).

Fields

§properties: Vec<StyleProperty>
§span: Span
§

Faq

FAQ accordion with question/answer pairs.

Fields

§items: Vec<FaqItem>
§span: Span
§

PricingTable

Pricing comparison table.

Fields

§headers: Vec<String>
§rows: Vec<Vec<String>>
§span: Span
§

Site

Site-level configuration (one per document).

Fields

§domain: Option<String>
§properties: Vec<StyleProperty>
§span: Span
§

Page

Page/route definition — container block with child blocks.

Fields

§route: String
§layout: Option<String>
§sidebar: bool
§content: String

Raw content for degradation renderers.

§children: Vec<Block>

Parsed child blocks (leaf directives resolved, rest as Markdown).

§span: Span

Trait Implementations§

Source§

impl Clone for Block

Source§

fn clone(&self) -> Block

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 Block

Source§

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

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

impl<'de> Deserialize<'de> for Block

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 Serialize for Block

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

Auto Trait Implementations§

§

impl Freeze for Block

§

impl RefUnwindSafe for Block

§

impl Send for Block

§

impl Sync for Block

§

impl Unpin for Block

§

impl UnwindSafe for Block

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> 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>,