Skip to main content

WireNode

Enum WireNode 

Source
#[non_exhaustive]
pub enum WireNode { Document { range: Range, origin: Option<String>, children: Vec<WireNode>, }, Session { range: Range, origin: Option<String>, title: String, marker: Option<String>, children: Vec<WireNode>, }, Definition { range: Range, origin: Option<String>, subject: String, children: Vec<WireNode>, }, Paragraph { range: Range, origin: Option<String>, inlines: Vec<WireInline>, }, List { range: Range, origin: Option<String>, marker_style: String, items: Vec<WireListItem>, }, Verbatim { range: Range, origin: Option<String>, label: String, params: Value, body_text: String, subject: String, mode: String, }, Table { range: Range, origin: Option<String>, caption: String, header_rows: u32, column_aligns: Vec<String>, rows: Vec<WireRow>, footnotes: Vec<WireFootnote>, }, Image { range: Range, origin: Option<String>, src: String, alt: String, title: Option<String>, }, Video { range: Range, origin: Option<String>, src: String, title: Option<String>, poster: Option<String>, }, Audio { range: Range, origin: Option<String>, src: String, title: Option<String>, }, Annotation { range: Range, origin: Option<String>, label: String, params: Value, body: Value, }, Blank { range: Range, origin: Option<String>, }, }
Expand description

A block-level wire AST node. Wire form is a tagged object with "kind" selecting the variant, plus shared range and optional origin fields.

See the module-level docs for the forward-compatibility contract.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Document

Fields

§range: Range
§origin: Option<String>
§children: Vec<WireNode>
§

Session

Fields

§range: Range
§origin: Option<String>
§title: String
§marker: Option<String>
§children: Vec<WireNode>
§

Definition

Fields

§range: Range
§origin: Option<String>
§subject: String
§children: Vec<WireNode>
§

Paragraph

Fields

§range: Range
§origin: Option<String>
§inlines: Vec<WireInline>
§

List

Fields

§range: Range
§origin: Option<String>
§marker_style: String
§

Verbatim

Fields

§range: Range
§origin: Option<String>
§label: String
§params: Value
§body_text: String
§subject: String

The verbatim block’s subject (the lead-in line, e.g. Code:). Empty string for verbatim blocks that have no subject (or for the placeholder shape used to flag unsupported variants).

§mode: String

Rendering mode: "inflow" (content indented relative to subject) or "fullwidth" (content at column 2). Defaults to "inflow" on deserialise — matching the parser’s default mode — when the field is absent from the wire payload.

§

Table

Fields

§range: Range
§origin: Option<String>
§caption: String
§header_rows: u32
§column_aligns: Vec<String>

Per-column alignment. One entry per column; values are "left", "center", "right", or "" (no alignment). column_aligns.length defines the table’s column count and MUST equal the longest row in rows; rows MUST NOT exceed this length. See lex-extension-wire.lex §2.2.

Replaces the single whole-table align: String from wire_version: 1. The old shape collapsed mixed-alignment tables (e.g. a markdown pipe-table with | :--- | :---: |) to a single alignment on the reverse codec.

§rows: Vec<WireRow>
§footnotes: Vec<WireFootnote>
§

Image

Image media node. Produced by on_resolve for lex.media.image-class verbatim labels; carries the same data the host would otherwise flatten into verbatim.params. New in wire_version: 2 — see lex-extension-wire.lex §2.2.

Fields

§range: Range
§origin: Option<String>
§

Video

Video media node. New in wire_version: 2.

Fields

§range: Range
§origin: Option<String>
§poster: Option<String>
§

Audio

Audio media node. New in wire_version: 2.

Fields

§range: Range
§origin: Option<String>
§

Annotation

Fields

§range: Range
§origin: Option<String>
§label: String
§params: Value
§body: Value

null for marker-form annotations, a string for opaque-text bodies, an object { "kind": "block", "children": [...] } for parsed-Lex bodies. See AnnotationBody for the corresponding LabelCtx shape.

§

Blank

Fields

§range: Range
§origin: Option<String>

Implementations§

Source§

impl WireNode

Source

pub fn range(&self) -> Range

The byte range this node spans in its origin source. Useful for diagnostic attribution when the host only has the wire node (e.g., the on_format dispatch path doesn’t carry a separate NodeRef).

Trait Implementations§

Source§

impl Clone for WireNode

Source§

fn clone(&self) -> WireNode

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WireNode

Source§

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

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

impl<'de> Deserialize<'de> for WireNode

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 WireNode

Source§

fn eq(&self, other: &WireNode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 WireNode

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 WireNode

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

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.