rustfmt_nightly::chains

Trait ChainFormatter

Source
trait ChainFormatter {
    // Required methods
    fn format_root(
        &mut self,
        parent: &ChainItem,
        context: &RewriteContext<'_>,
        shape: Shape,
    ) -> Result<(), RewriteError>;
    fn child_shape(
        &self,
        context: &RewriteContext<'_>,
        shape: Shape,
    ) -> Option<Shape>;
    fn format_children(
        &mut self,
        context: &RewriteContext<'_>,
        child_shape: Shape,
    ) -> Result<(), RewriteError>;
    fn format_last_child(
        &mut self,
        context: &RewriteContext<'_>,
        shape: Shape,
        child_shape: Shape,
    ) -> Result<(), RewriteError>;
    fn join_rewrites(
        &self,
        context: &RewriteContext<'_>,
        child_shape: Shape,
    ) -> Result<String, RewriteError>;
    fn pure_root(&mut self) -> Option<String>;
}

Required Methods§

Source

fn format_root( &mut self, parent: &ChainItem, context: &RewriteContext<'_>, shape: Shape, ) -> Result<(), RewriteError>

Source

fn child_shape( &self, context: &RewriteContext<'_>, shape: Shape, ) -> Option<Shape>

Source

fn format_children( &mut self, context: &RewriteContext<'_>, child_shape: Shape, ) -> Result<(), RewriteError>

Source

fn format_last_child( &mut self, context: &RewriteContext<'_>, shape: Shape, child_shape: Shape, ) -> Result<(), RewriteError>

Source

fn join_rewrites( &self, context: &RewriteContext<'_>, child_shape: Shape, ) -> Result<String, RewriteError>

Source

fn pure_root(&mut self) -> Option<String>

Implementors§