pub struct HardBlock {
pub indent: usize,
pub lhs: &'static str,
pub rhs: &'static str,
pub joint: 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
Implementations§
Source§impl HardBlock
impl HardBlock
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 HardBlock
impl HardBlock
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 HardBlock
impl !RefUnwindSafe for HardBlock
impl !Send for HardBlock
impl !Sync for HardBlock
impl Unpin for HardBlock
impl !UnwindSafe for HardBlock
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