Skip to main content

Row

Struct Row 

Source
pub struct Row {
    pub runs: Vec<Run>,
    pub decoration: bool,
    pub code: bool,
    pub code_lang: Option<String>,
    pub directive: bool,
    pub directive_label: Option<String>,
    pub heading: Option<u8>,
    pub align: Option<String>,
    pub line_height: Option<String>,
    pub boundary: Option<Boundary>,
}
Expand description

One visual line: its styled runs plus the row-level flags a frontend draws chrome from.

Fields§

§runs: Vec<Run>§decoration: bool

Drawn but holds no caret (a table rule, a block-gap blank line): the renderer skips it for click/caret math. See leaf_core::VRow.

§code: bool

A fenced/indented code-block line — the renderer draws a tinted, bordered panel around each maximal run of these.

§code_lang: Option<String>

A fenced block’s language, carried on the block’s first code row only.

§directive: bool

A :::name{.class} directive-container line — the renderer draws a tinted panel around each maximal run of these, the code recipe. See leaf_core::VRow::directive.

§directive_label: Option<String>

A directive container’s space-joined .class attrs, carried on the block’s first row only. See leaf_core::VRow::directive_label.

§heading: Option<u8>

The heading level (1–6) if this row belongs to a heading block, else None. A proportional renderer sizes the whole row from this so an inline `code` run inside a heading still reads at the heading’s size.

§align: Option<String>

How this row’s block is aligned across the measure — "center", "right", "justify" — and None for the theme’s default, which is left. On every row the block emits.

A row fact and not a run one for heading’s reason, and more sharply: alignment is a property of the line, not of the letters on it, so an empty paragraph the author has just centred carries it with no run to hang it on. A renderer sets its paragraph style’s alignment from it. See leaf_core::VRow::align.

§line_height: Option<String>

How far apart this row’s block sets its lines, as a multiple of the theme’s own line height — the menu’s three ("1.15", "1.5", "2") or any other positive decimal the author asked for ("1.3") — and None for the theme’s spacing, which is what "1" would mean and is why it is never written. On every row the block emits.

The token is the ratio, so a renderer laying rows out in points multiplies its line height by it whether or not the menu has a row for it; one drawing a row per terminal line ignores it, the way it ignores a heading’s size. See leaf_core::VRow::line_height.

§boundary: Option<Boundary>

What this row divides, on the blank rows a block boundary is drawn with and None everywhere else — so boundary != nil is exactly “this row is a drawn block boundary”. A frontend spaces a boundary by the pair it falls between (the margin above a heading is wider than the one between two paragraphs); the height is the frontend’s, the kind is core’s. See leaf_core::Boundary.

Trait Implementations§

Source§

impl<UT> ConvertError<UT> for Row

Source§

impl<UT> FfiConverter<UT> for Row

Source§

const TYPE_ID_META: MetadataBuffer

Type ID metadata, serialized into a MetadataBuffer.
Source§

type FfiType = RustBuffer

The low-level type used for passing values of this type over the FFI. Read more
Source§

fn lower(v: Self) -> RustBuffer

Lower a rust value of the target type, into an FFI value of type Self::FfiType. Read more
Source§

fn try_lift(buf: RustBuffer) -> Result<Self>

Lift a rust value of the target type, from an FFI value of type Self::FfiType. Read more
Source§

fn write(obj: Self, buf: &mut Vec<u8>)

Write a rust value into a buffer, to send over the FFI in serialized form. Read more
Source§

fn try_read(buf: &mut &[u8]) -> Result<Self>

Read a rust value from a buffer, received over the FFI in serialized form. Read more
Source§

impl<UT> Lift<UT> for Row

Source§

type FfiType = <Row as FfiConverter<UT>>::FfiType

Source§

fn try_lift(v: Self::FfiType) -> Result<Self>

Source§

fn try_read(buf: &mut &[u8]) -> Result<Self>

Source§

fn try_lift_from_rust_buffer(v: RustBuffer) -> Result<Self, Error>

Convenience method
Source§

impl<UT> LiftRef<UT> for Row

Source§

impl<UT> LiftReturn<UT> for Row

Source§

type ReturnType = <Row as Lift<UT>>::FfiType

FFI return type for trait interfaces
Source§

fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>

Lift a successfully returned value from a trait interface
Source§

fn lift_foreign_return( ffi_return: Self::ReturnType, call_status: RustCallStatus, ) -> Self

Lift a foreign returned value from a trait interface Read more
Source§

fn lift_error(_buf: RustBuffer) -> Self

Lift a Rust value for a callback interface method error result Read more
Source§

fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self

Lift a Rust value for an unexpected callback interface error Read more
Source§

impl<UT> Lower<UT> for Row

Source§

type FfiType = <Row as FfiConverter<UT>>::FfiType

Source§

fn lower(obj: Self) -> Self::FfiType

Source§

fn write(obj: Self, buf: &mut Vec<u8>)

Source§

fn lower_into_rust_buffer(obj: Self) -> RustBuffer

Convenience method
Source§

impl<UT> LowerError<UT> for Row

Source§

fn lower_error(obj: Self) -> RustBuffer

Lower this value for scaffolding function return Read more
Source§

impl<UT> LowerReturn<UT> for Row

Source§

type ReturnType = <Row as Lower<UT>>::FfiType

The type that should be returned by scaffolding functions for this type. Read more
Source§

fn lower_return(v: Self) -> Result<Self::ReturnType, RustCallError>

Lower the return value from an scaffolding call Read more
Source§

fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>

Lower the return value for failed argument lifts Read more
Source§

impl<UT> TypeId<UT> for Row

Auto Trait Implementations§

§

impl Freeze for Row

§

impl RefUnwindSafe for Row

§

impl Send for Row

§

impl Sync for Row

§

impl Unpin for Row

§

impl UnsafeUnpin for Row

§

impl UnwindSafe for Row

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

Source§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
Source§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
Source§

unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ

Consume a handle, getting back the initial Arc<> Read more
Source§

unsafe fn get_arc(handle: Handle) -> Arc<Self> ⓘ

Get a clone of the Arc<> using a “borrowed” handle. Read more
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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.