pub fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
        for m in self.macros.iter() {
            write!(fmt, "{}\n", m)?;
        }
        write!(fmt, "impl")?;
        fmt_generics(&self.generics[..], fmt)?;

        if let Some(ref t) = self.impl_trait {
            write!(fmt, " ")?;
            t.fmt(fmt)?;
            write!(fmt, " for")?;
        }

        write!(fmt, " ")?;
        self.target.fmt(fmt)?;

        fmt_bounds(&self.bounds, fmt)?;

        fmt.block(|fmt| {
            // format associated types
            if !self.assoc_tys.is_empty() {
                for ty in &self.assoc_tys {
                    write!(fmt, "type {} = ", ty.name)?;
                    ty.ty.fmt(fmt)?;
                    write!(fmt, ";\n")?;
                }
            }

            for (i, func) in self.fns.iter().enumerate() {
                if i != 0 || !self.assoc_tys.is_empty() {
                    write!(fmt, "\n")?;
                }

                func.fmt(false, fmt)?;
            }

            Ok(())
        })
    }
/// Formats the impl block using the given formatter.
Formats the impl block using the given formatter.
Formats the impl block using the given formatter .
pub fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
        for m in self.macros.iter() {
            write!(fmt, "{}\n", m)?;
        }
        write!(fmt, "impl")?;
        fmt_generics(&self.generics[..], fmt)?;
        if let Some(ref t) = self.impl_trait {
            write!(fmt, " ")?;
            t.fmt(fmt)?;
            write!(fmt, " for")?;
        }
        write!(fmt, " ")?;
        self.target.fmt(fmt)?;
        fmt_bounds(&self.bounds, fmt)?;
        fmt.block(|fmt| {
            // format associated types
            if !self.assoc_tys.is_empty() {
                for ty in &self.assoc_tys {
                    write!(fmt, "type {} = ", ty.name)?;
                    ty.ty.fmt(fmt)?;
                    write!(fmt, ";\n")?;
                }
            }
            for (i, func) in self.fns.iter().enumerate() {
                if i != 0 || !self.assoc_tys.is_empty() {
                    write!(fmt, "\n")?;
                }
                func.fmt(false, fmt)?;
            }
            Ok(())
        })
    }
pub fn fmt ( & self , fmt : & mut Formatter < ' _ > ) -> fmt :: Result { for m in self . macros . iter ( ) { write ! ( fmt " \n " m ) ? ; } write ! ( fmt " " ) ? ; fmt_generics ( & self . generics [ .. ] , fmt ) ? ; if let Some ( ref t ) = self . impl_trait { write ! ( fmt " " ) ? ; t . fmt ( fmt ) ? ; write ! ( fmt " " ) ? ; } write ! ( fmt " " ) ? ; self . target . fmt ( fmt ) ? ; fmt_bounds ( & self . bounds , fmt ) ? ; fmt . block ( | fmt | { // format associated types if ! self . assoc_tys . is_empty ( ) { for ty in & self . assoc_tys { write ! ( fmt " " ty name ) ? ; ty . ty . fmt ( fmt ) ? ; write ! ( fmt " \n " ) ? ; } } for ( i , func ) in self . fns . iter ( ) . enumerate ( ) { if i != 0 || ! self . assoc_tys . is_empty ( ) { write ! ( fmt " \n " ) ? ; } func . fmt ( false , fmt ) ? ; } Ok ( ( ) ) } ) }
Formats the impl block using the given formatter.
Formats the impl block using the given formatter .
&self
fmt
&mut Formatter<'_>