Skip to main content

ParaBuilder

Struct ParaBuilder 

Source
pub struct ParaBuilder { /* private fields */ }
Expand description

段落 / 标题的行内内容构建器(也用于图注)。

Implementations§

Source§

impl ParaBuilder

Source

pub fn align(&mut self, a: Align) -> &mut Self

设对齐。

Source

pub fn text(&mut self, s: impl Into<String>) -> &mut Self

普通文字。

Source

pub fn bold(&mut self, s: impl Into<String>) -> &mut Self

粗体文字。

Source

pub fn light(&mut self, s: impl Into<String>) -> &mut Self

细体文字(字重 300)。

Source

pub fn italic(&mut self, s: impl Into<String>) -> &mut Self

斜体文字。

Source

pub fn underline(&mut self, s: impl Into<String>) -> &mut Self

下划线文字。

Source

pub fn strike(&mut self, s: impl Into<String>) -> &mut Self

删除线文字。

Source

pub fn highlight(&mut self, s: impl Into<String>) -> &mut Self

高亮文字(主题默认高亮色)。

Source

pub fn color(&mut self, hex: &str, s: impl Into<String>) -> &mut Self

指定色文字(十六进制;非法则用默认色)。

Source

pub fn code(&mut self, s: impl Into<String>) -> &mut Self

行内代码。

Source

pub fn styled<R>( &mut self, s: impl Into<String>, f: impl FnOnce(&mut StyleBuilder) -> R, ) -> &mut Self

任意样式文字:闭包里配置 StyleBuilder

Source

pub fn line_break(&mut self) -> &mut Self

硬换行。

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> ErasedDestructor for T
where T: 'static,

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.