Struct below_render::RenderConfig
source · 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:
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§
source§impl RenderConfig
impl RenderConfig
pub fn update<T: Into<Self>>(self, overrides: T) -> Self
pub fn get_title(&self) -> &str
pub fn render_title(&self, fixed_width: bool) -> String
sourcepub fn render_indented(
&self,
field: Option<Field>,
fixed_width: bool,
depth: usize
) -> String
pub fn render_indented( &self, field: Option<Field>, fixed_width: bool, depth: usize ) -> String
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.
Trait Implementations§
source§impl Clone for RenderConfig
impl Clone for RenderConfig
source§fn clone(&self) -> RenderConfig
fn clone(&self) -> RenderConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more