pub struct Section {
pub title: String,
pub level: u8,
pub style_ref: Option<String>,
}Expand description
A section heading at one of three nesting levels.
Level 1 uses DocumentStyle.font_size_title and primary_color.
Level 2 uses font_size_section.
Level 3 uses font_size_body with bold weight.
A style_ref can point to a named style (e.g. "heading_1") to override
the default level-based sizing and spacing.
Fields§
§title: String§level: u81 = main title, 2 = subtitle, 3 = sub-section.
style_ref: Option<String>Optional named style override. When set, resolved style provides font size,
spacing, and colour. Falls back to the built-in heading_1/2/3 when None.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Section
impl<'de> Deserialize<'de> for Section
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 Element for Section
impl Element for Section
fn as_section_info(&self) -> Option<(u8, &str)>
fn estimated_height_mm(&self) -> f64
fn render(&self, ctx: &mut RenderContext) -> Result<RenderResult>
fn layout_mode(&self) -> LayoutMode
fn inject_toc_entries(&mut self, _entries: &[TocEntry])
Auto Trait Implementations§
impl Freeze for Section
impl RefUnwindSafe for Section
impl Send for Section
impl Sync for Section
impl Unpin for Section
impl UnsafeUnpin for Section
impl UnwindSafe for Section
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.