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
sourceimpl 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
sourceimpl Clone for RenderConfig
impl Clone for RenderConfig
sourcefn clone(&self) -> RenderConfig
fn clone(&self) -> RenderConfig
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Default for RenderConfig
impl Default for RenderConfig
sourcefn default() -> RenderConfig
fn default() -> RenderConfig
Returns the “default value” for a type. Read more
sourceimpl From<RenderConfig> for RenderConfigBuilder
impl From<RenderConfig> for RenderConfigBuilder
sourcefn from(rc: RenderConfig) -> Self
fn from(rc: RenderConfig) -> Self
Converts to this type from the input type.
sourceimpl From<RenderConfigBuilder> for RenderConfig
impl From<RenderConfigBuilder> for RenderConfig
sourcefn from(b: RenderConfigBuilder) -> Self
fn from(b: RenderConfigBuilder) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for RenderConfig
impl Send for RenderConfig
impl Sync for RenderConfig
impl Unpin for RenderConfig
impl UnwindSafe for RenderConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more