rustfmt_nightly::rewrite

Trait Rewrite

Source
pub(crate) trait Rewrite {
    // Required method
    fn rewrite(
        &self,
        context: &RewriteContext<'_>,
        shape: Shape,
    ) -> Option<String>;

    // Provided method
    fn rewrite_result(
        &self,
        context: &RewriteContext<'_>,
        shape: Shape,
    ) -> Result<String, RewriteError> { ... }
}

Required Methods§

Source

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

Rewrite self into shape.

Provided Methods§

Source

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

Implementations on Foreign Types§

Source§

impl Rewrite for AssocItemConstraintKind

Source§

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

Source§

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

Source§

impl Rewrite for FnRetTy

Source§

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

Source§

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

Source§

impl Rewrite for GenericArg

Source§

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

Source§

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

Source§

impl Rewrite for GenericBound

Source§

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

Source§

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

Source§

impl Rewrite for MetaItemInner

Source§

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

Source§

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

Source§

impl Rewrite for PreciseCapturingArg

Source§

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

Source§

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

Source§

impl Rewrite for WherePredicate

Source§

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

Source§

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

Source§

impl Rewrite for AnonConst

Source§

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

Source§

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

Source§

impl Rewrite for AssocItemConstraint

Source§

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

Source§

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

Source§

impl Rewrite for Attribute

Source§

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

Source§

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

Source§

impl Rewrite for Block

Source§

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

Source§

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

Source§

impl Rewrite for Expr

Source§

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

Source§

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

Source§

impl Rewrite for FieldDef

Source§

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

Source§

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

Source§

impl Rewrite for GenericParam

Source§

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

Source§

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

Source§

impl Rewrite for Item

Source§

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

Source§

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

Source§

impl Rewrite for Lifetime

Source§

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

Source§

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

Source§

impl Rewrite for Local

Source§

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

Source§

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

Source§

impl Rewrite for MetaItem

Source§

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

Source§

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

Source§

impl Rewrite for Param

Source§

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

Source§

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

Source§

impl Rewrite for Pat

Source§

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

Source§

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

Source§

impl Rewrite for PatField

Source§

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

Source§

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

Source§

impl Rewrite for PolyTraitRef

Source§

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

Source§

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

Source§

impl Rewrite for TraitRef

Source§

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

Source§

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

Source§

impl Rewrite for Ty

Source§

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

Source§

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

Source§

impl Rewrite for ForeignItem

Source§

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

Source§

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

Source§

impl Rewrite for GenericBounds

Source§

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

Source§

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

Source§

impl Rewrite for [Attribute]

Source§

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

Source§

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

Source§

impl<T: Rewrite> Rewrite for P<T>

Source§

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

Implementors§