pub struct SoftBlock<'a, T> {
pub indent: usize,
pub lhs: &'static str,
pub rhs: &'static str,
pub joint: PrettyTree<'a, T>,
pub tail: PrettyTree<'a, T>,
}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: PrettyTree<'a, T>The joint node of the soft block
tail: PrettyTree<'a, T>The tail node of the soft block
Implementations§
Source§impl<'a, T: Text<'a>> SoftBlock<'a, T>
impl<'a, T: Text<'a>> SoftBlock<'a, T>
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<'a, T>) -> Self
pub fn with_joint(self, joint: PrettyTree<'a, T>) -> Self
Set the joint node of the soft block
Source§impl<'a, T: Text<'a> + Clone> SoftBlock<'a, T>
impl<'a, T: Text<'a> + Clone> SoftBlock<'a, T>
Sourcepub fn join_slice<U: PrettyPrint<'a, T>>(
&self,
slice: &[U],
theme: &PrettyProvider,
) -> PrettyTree<'a, T>
pub fn join_slice<U: PrettyPrint<'a, T>>( &self, slice: &[U], theme: &PrettyProvider, ) -> PrettyTree<'a, T>
Join a slice of pretty printables with the soft block
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for SoftBlock<'a, T>where
T: Freeze,
impl<'a, T> !RefUnwindSafe for SoftBlock<'a, T>
impl<'a, T> !Send for SoftBlock<'a, T>
impl<'a, T> !Sync for SoftBlock<'a, T>
impl<'a, T> Unpin for SoftBlock<'a, T>where
T: Unpin,
impl<'a, T> UnsafeUnpin for SoftBlock<'a, T>where
T: UnsafeUnpin,
impl<'a, T> !UnwindSafe for SoftBlock<'a, T>
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