# Trait rustfmt_nightly::rewrite::Rewrite

source ·

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

## Required Methods§

source

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

Rewrite self into shape.

## Implementations on Foreign Types§

source§

### impl Rewrite for AssocItemConstraintKind

source§

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

source§

### impl Rewrite for FnRetTy

source§

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

source§

### impl Rewrite for GenericArg

source§

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

source§

### impl Rewrite for GenericBound

source§

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

source§

### impl Rewrite for NestedMetaItem

source§

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

source§

### impl Rewrite for PreciseCapturingArg

source§

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

source§

### impl Rewrite for WherePredicate

source§

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

source§

### impl Rewrite for AnonConst

source§

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

source§

### impl Rewrite for AssocItemConstraint

source§

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

source§

### impl Rewrite for Attribute

source§

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

source§

### impl Rewrite for Block

source§

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

source§

### impl Rewrite for Expr

source§

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

source§

### impl Rewrite for FieldDef

source§

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

source§

### impl Rewrite for GenericParam

source§

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

source§

### impl Rewrite for Item

source§

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

source§

### impl Rewrite for Lifetime

source§

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

source§

### impl Rewrite for Local

source§

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

source§

### impl Rewrite for MetaItem

source§

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

source§

### impl Rewrite for Param

source§

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

source§

### impl Rewrite for Pat

source§

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

source§

### impl Rewrite for PatField

source§

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

source§

### impl Rewrite for PolyTraitRef

source§

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

source§

### impl Rewrite for TraitRef

source§

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

source§

### impl Rewrite for Ty

source§

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

source§

### impl Rewrite for ForeignItem

source§

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

source§

### impl Rewrite for GenericBounds

source§

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

source§

### impl Rewrite for [Attribute]

source§

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

source§

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

source§

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

## Implementors§

source§

### impl Rewrite for MacroArg

source§

### impl Rewrite for Chain

source§

### impl Rewrite for ChainItem

source§

### impl Rewrite for UseSegment

source§

### impl Rewrite for UseTree

source§

### impl<'a> Rewrite for OverflowableItem<'a>

source§

### impl<'a> Rewrite for TuplePatField<'a>

source§

### impl<'a> Rewrite for SegmentParam<'a>

source§

### impl<'a> Rewrite for ControlFlow<'a>

source§

### impl<'a> Rewrite for OpaqueType<'a>

source§

### impl<'a> Rewrite for TraitAliasBounds<'a>

source§

### impl<'a> Rewrite for ArmWrapper<'a>

source§

### impl<'a> Rewrite for RangeOperand<'a>

source§

### impl<'a> Rewrite for Stmt<'a>