#[non_exhaustive]pub enum MultilineStyle {
Floating,
Bold,
BoldFloating,
Transparent,
Light,
FoldingQuotes,
}Expand description
Controls which multiline string format is preferred when rendering strings with newlines.
Only affects strings that contain at least one EOL (LF or CRLF). Single-line strings
always follow the normal bare_strings / string_quoted_fold_style options.
Bold(``, default): double backtick, body always at col 2. Always safe.Floating(`): single backtick, body atn+2. Falls back toBoldwhen any content line would overflowwrap_widthat that indent, or when the string exceedsmultiline_max_lines, or when content is pipe-heavy / backtick-starting.BoldFloating(``): double backtick, body atn+2when it fits, col 2 when it overflows.Transparent(```): triple backtick, body at col 0. Falls back toBoldwhen content is pipe-heavy or has backtick-starting lines (visually unsafe in that format).Light(`or``): prefers`; falls back to``likeFloating, but the fallback reason differs — see variant doc for details.FoldingQuotes(JSON string with/folds): never uses any multiline string format. Renders EOL-containing strings as folded JSON strings. When the encoded string is within 25 % ofwrap_widthfrom fitting, it is emitted unfolded (overrunning the limit is preferred over a fold that saves almost nothing).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Floating
` with body at n+2; falls back to Bold on overflow or excessive length.
Bold
`` with body always at col 2.
BoldFloating
`` with body at n+2 when it fits, col 2 when any line overflows wrap_width.
Transparent
``` with body at col 0; falls back to Bold when content is pipe-heavy or
starts with backtick characters. string_multiline_fold_style has no effect here —
/ continuations are not allowed inside triple-backtick blocks.
Light
` preferred; falls back to `` only when content looks like TJSON markers
(pipe-heavy or backtick-starting lines). Width overflow and line count do NOT trigger
fallback — a long ` is preferred over the heavier `` format.
FoldingQuotes
Always a JSON string for EOL-containing strings; folds with / to fit wrap_width
unless the overrun is within 25 % of wrap_width.
Trait Implementations§
Source§impl Clone for MultilineStyle
impl Clone for MultilineStyle
Source§fn clone(&self) -> MultilineStyle
fn clone(&self) -> MultilineStyle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MultilineStyle
impl Debug for MultilineStyle
Source§impl Default for MultilineStyle
impl Default for MultilineStyle
Source§fn default() -> MultilineStyle
fn default() -> MultilineStyle
Source§impl<'de> Deserialize<'de> for MultilineStyle
impl<'de> Deserialize<'de> for MultilineStyle
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>,
Source§impl FromStr for MultilineStyle
impl FromStr for MultilineStyle
Source§impl PartialEq for MultilineStyle
impl PartialEq for MultilineStyle
Source§impl Serialize for MultilineStyle
impl Serialize for MultilineStyle
impl Copy for MultilineStyle
impl Eq for MultilineStyle
impl StructuralPartialEq for MultilineStyle
Auto Trait Implementations§
impl Freeze for MultilineStyle
impl RefUnwindSafe for MultilineStyle
impl Send for MultilineStyle
impl Sync for MultilineStyle
impl Unpin for MultilineStyle
impl UnsafeUnpin for MultilineStyle
impl UnwindSafe for MultilineStyle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.