LayoutSpec

Struct LayoutSpec 

Source
pub struct LayoutSpec {
    pub width: Option<u32>,
    pub height: Option<u32>,
    pub padding: Option<u32>,
    pub line_spacing: Option<u32>,
    pub align: Option<TextAlign>,
    pub v_align: Option<VerticalAlign>,
}
Expand description

Layout configuration for the rendering canvas.

Defines the overall size, spacing, and alignment of the output area. All fields are optional and will fall back to theme or default values.

Fieldsยง

ยงwidth: Option<u32>

Canvas width in pixels. Determines maximum horizontal space for line wrapping and positioning.

ยงheight: Option<u32>

Canvas height in pixels. Determines maximum vertical space for rendering content blocks.

ยงpadding: Option<u32>

Optional padding (in pixels) applied to all sides. Creates spacing between the border and inner content.

ยงline_spacing: Option<u32>

Optional line spacing between text lines (in pixels). Affects vertical rhythm and visual readability.

ยงalign: Option<TextAlign>

Horizontal text alignment: [Left] | [Center] | [Right]. Applies to each line or block within the canvas.

ยงv_align: Option<VerticalAlign>

Vertical alignment of the entire content block: [Top] | [Middle] | [Bottom]. Controls placement within the total canvas height.

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