#[non_exhaustive]pub enum Indent {
None,
Block,
Hanging,
}Expand description
How a node indents its contents.
§Examples
use fmt_lang::{Indent, NodeRule, Space};
// A block: `{`, an indented body, then `}` back at the block's level.
let block = NodeRule::new("block").delimiters("{", "}", Space::Hard).indent(Indent::Block);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
None
No indentation of its own.
Block
Indent the body between the node’s delimiters (NodeRule::delimiters):
every line break after the opening delimiter and before the closing one.
The closing delimiter itself returns to the node’s level. Without
delimiters present in the tree, nothing is indented.
Hanging
Indent every line break inside the node (a hanging indent, as for a long binary expression that wraps).
Trait Implementations§
impl Copy for Indent
impl Eq for Indent
impl StructuralPartialEq for Indent
Auto Trait Implementations§
impl Freeze for Indent
impl RefUnwindSafe for Indent
impl Send for Indent
impl Sync for Indent
impl Unpin for Indent
impl UnsafeUnpin for Indent
impl UnwindSafe for Indent
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
Mutably borrows from an owned value. Read more