pub struct SoftBlock {
pub indent: usize,
pub lhs: &'static str,
pub rhs: &'static str,
pub joint: PrettyTree,
pub tail: PrettyTree,
}Expand description
A soft block is a block that is not required to be on a new line.
{a, b, c}
{
a,
b,
}Fields§
§indent: usizeThe indentation of the soft block
lhs: &'static strThe left hand side of the soft block
rhs: &'static strThe right hand side of the soft block
joint: PrettyTreeThe joint node of the soft block
tail: PrettyTreeThe tail node of the soft block
Implementations§
Source§impl SoftBlock
impl SoftBlock
Sourcepub fn parentheses() -> Self
pub fn parentheses() -> Self
Build a new soft block with the parentheses syntax
Sourcepub fn curly_braces() -> Self
pub fn curly_braces() -> Self
Build a new soft block with the curly braces syntax
Sourcepub fn with_joint(self, joint: PrettyTree) -> Self
pub fn with_joint(self, joint: PrettyTree) -> Self
Set the joint node of the soft block
Source§impl SoftBlock
impl SoftBlock
Sourcepub fn join_slice<T: PrettyPrint>(
&self,
slice: &[T],
theme: &PrettyProvider,
) -> PrettyTree
pub fn join_slice<T: PrettyPrint>( &self, slice: &[T], theme: &PrettyProvider, ) -> PrettyTree
Join a slice of pretty printables with the soft block
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SoftBlock
impl !RefUnwindSafe for SoftBlock
impl !Send for SoftBlock
impl !Sync for SoftBlock
impl Unpin for SoftBlock
impl !UnwindSafe for SoftBlock
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