pub enum Layout {
Indent(Vec<Layout>, Option<usize>),
Stack(Vec<Layout>),
Row(Vec<Layout>, String),
Apply(Box<Layout>),
Item(String),
Ann(HashMap<String, Expr>, Box<Layout>),
Separator,
}
Expand description
A Layout is an abstract representation (model) of formatted source.
Variants§
Indent(Vec<Layout>, Option<usize>)
Indentation block, supports both indentation and alignment.
Stack(Vec<Layout>)
Vertical arrangement
Row(Vec<Layout>, String)
Horizontal arrangement
Apply(Box<Layout>)
Item(String)
Ann(HashMap<String, Expr>, Box<Layout>)
Separator
Implementations§
Source§impl Layout
impl Layout
pub fn indent(list: Vec<Layout>) -> Self
pub fn align(list: Vec<Layout>, indent_size: usize) -> Self
pub fn row(list: impl Into<Vec<Layout>>) -> Self
pub fn join(list: impl Into<Vec<Layout>>) -> Self
pub fn apply(l: Layout) -> Self
pub fn item(s: impl Into<String>) -> Self
pub fn space() -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Layout
impl !RefUnwindSafe for Layout
impl Send for Layout
impl Sync for Layout
impl Unpin for Layout
impl !UnwindSafe for Layout
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