pub fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
        self.type_def.fmt_head("trait", &self.parents, fmt)?;

        fmt.block(|fmt| {
            let assoc = &self.associated_tys;

            // format associated types
            if !assoc.is_empty() {
                for ty in assoc {
                    let ty = &ty.0;

                    write!(fmt, "type {}", ty.name)?;

                    if !ty.bound.is_empty() {
                        write!(fmt, ": ")?;
                        fmt_bound_rhs(&ty.bound, fmt)?;
                    }

                    write!(fmt, ";\n")?;
                }
            }

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

                func.fmt(true, fmt)?;
            }

            Ok(())
        })
    }
/// Formats the scope using the given formatter.
Formats the scope using the given formatter.
Formats the scope using the given formatter .
pub fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
        self.type_def.fmt_head("trait", &self.parents, fmt)?;
        fmt.block(|fmt| {
            let assoc = &self.associated_tys;
            // format associated types
            if !assoc.is_empty() {
                for ty in assoc {
                    let ty = &ty.0;
                    write!(fmt, "type {}", ty.name)?;
                    if !ty.bound.is_empty() {
                        write!(fmt, ": ")?;
                        fmt_bound_rhs(&ty.bound, fmt)?;
                    }
                    write!(fmt, ";\n")?;
                }
            }
            for (i, func) in self.fns.iter().enumerate() {
                if i != 0 || !assoc.is_empty() {
                    write!(fmt, "\n")?;
                }
                func.fmt(true, fmt)?;
            }
            Ok(())
        })
    }
pub fn fmt ( & self , fmt : & mut Formatter ) -> fmt :: Result { self . type_def . fmt_head ( " " , & self . parents , fmt ) ? ; fmt . block ( | fmt | { let assoc = & self . associated_tys ; // format associated types if ! assoc . is_empty ( ) { for ty in assoc { let ty = & ty . 0 ; write ! ( fmt " " ty name ) ? ; if ! ty . bound . is_empty ( ) { write ! ( fmt " " ) ? ; fmt_bound_rhs ( & ty . bound , fmt ) ? ; } write ! ( fmt " \n " ) ? ; } } for ( i , func ) in self . fns . iter ( ) . enumerate ( ) { if i != 0 || ! assoc . is_empty ( ) { write ! ( fmt " \n " ) ? ; } func . fmt ( true , fmt ) ? ; } Ok ( ( ) ) } ) }
Formats the scope using the given formatter.
Formats the scope using the given formatter .
&self
fmt
&mut Formatter
&self
fmt
&mut Formatter