Struct below_render::RenderConfig[][src]

pub struct RenderConfig {
    pub title: Option<String>,
    pub format: Option<RenderFormat>,
    pub indented_prefix: Option<String>,
    pub suffix: Option<String>,
    pub fold: Option<FoldOption>,
    pub width: Option<usize>,
}
Expand description

Config object for specifying how to render a Field. Options are ordered roughly by their order of processing.

Fields

title: Option<String>format: Option<RenderFormat>

Converting Field to String.

indented_prefix: Option<String>

Prefix when rendered with indent. Each extra level adds same number of spaces equal to the length of this prefix. This allows us to render: -+ branch -* leaf -* another_leaf The example above use two prefixes, “-+ “ and “-* “. Root has no prefix.

suffix: Option<String>fold: Option<FoldOption>

Fit a long rendered Field into smaller width by omitting some characters in the middle instead of truncating. Only applies when rendering Field with fixed width. Taken indent, prefix and suffix len into account.

width: Option<usize>

For fixed width rendering. Truncate or pad whitespace to output.

Implementations

Renders Field with all options applied. depth specifies the depth of the model of this Field, where the model is Recursive, i.e. it works as a node in a tree. Currently this only affects indented_prefix.

Renders Field with all options without indent.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the “default value” for a type. Read more

Performs the conversion.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Calls the given closure and return the result. Read more

Calls the given closure on self.

Calls the given closure on self.

Calls the given closure if condition == true.