Skip to main content

DirectiveMark

Struct DirectiveMark 

Source
pub struct DirectiveMark {
    pub name: String,
    pub attrs: Vec<(String, Option<String>)>,
    pub label: String,
    pub rows: usize,
}
Expand description

The name and attributes a leaf directive’s placeholder row carries, so a frontend that knows the host app’s vocabulary can paint the real thing — an embedded page for diaryx’s ::embed{src=…}, a generated table of contents for a ::toc, and the plain ⧉ name label for one it doesn’t know. The peer of MediaMark, and plain strings for the same reason: they survive the row shuffling of BlockCache reuse and build_spliced.

Fields§

§name: String

The directive’s type — embed, toc, vis — with no leading colons. Core is agnostic of what it means: the vocabulary is the host app’s.

§attrs: Vec<(String, Option<String>)>

Its {…} attributes as (key, value) pairs in source order. A bare attribute ({public}) has a None value, the way twig reports it.

§label: String

The directive’s [label] text, flattened from its inline children, or empty when it has none. Also what the placeholder label shows.

§rows: usize

How many visual rows this directive reserves — the label row plus blank filler rows below it, so a frontend painting something real has the vertical room. 1 is the bare placeholder, and the only value core produces today: unlike an image (whose height a terminal frontend measures and reports back), nothing has told core how tall an embed is. A pixel-laid-out GUI sets its own height regardless.

Trait Implementations§

Source§

impl Clone for DirectiveMark

Source§

fn clone(&self) -> DirectiveMark

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 DirectiveMark

Source§

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

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

impl Eq for DirectiveMark

Source§

impl PartialEq for DirectiveMark

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DirectiveMark

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