Trait Formattable

Source
pub trait Formattable {
    // Required method
    fn format(&self, ctx: &mut FormatterContext) -> FormattedLines;

    // Provided methods
    fn line_length_aware_format(
        &self,
        ctx: &mut FormatterContext,
    ) -> FormattedLines { ... }
    fn try_config(
        &self,
        ctx: &mut FormatterContext,
        config: FormatterConfig,
    ) -> FormattedLines { ... }
}

Required Methods§

Provided Methods§

Source

fn line_length_aware_format(&self, ctx: &mut FormatterContext) -> FormattedLines

the below is the actual entry point to the interface, which attempts to reformat the item with more things broken up across lines if the line length exceeds the limit

Source

fn try_config( &self, ctx: &mut FormatterContext, config: FormatterConfig, ) -> FormattedLines

Implementations on Foreign Types§

Source§

impl Formattable for AstNode

Source§

impl Formattable for Expression

Source§

impl Formattable for Ty

Source§

impl Formattable for Ast

Source§

impl Formattable for ExpressionWithBindings

Source§

impl Formattable for FunctionCall

Source§

impl Formattable for FunctionDeclaration

Source§

impl Formattable for FunctionParameter

Source§

impl Formattable for IntrinsicCall

Source§

impl Formattable for List

Source§

impl Formattable for Module

Source§

impl Formattable for TypeDeclaration

Source§

impl Formattable for TypeField

Source§

impl Formattable for TypeVariant

Source§

impl<T> Formattable for Commented<T>
where T: Formattable,

Implementors§