fn struct_decl(&self, cx: &ExtCtxt) -> P<ast::Item> {
        let name = self.struct_info.name.clone();
        let vis = if self.struct_info.public { ast::Public }
                  else { ast::Inherited };
        let def = ast::StructDef {
            fields: self.struct_fields(cx),
            ctor_id: None
        };

        let mut traits = vec!["RustcDecodable".to_string()];
        traits.push_all(self.struct_info.deriving.as_slice());
        let attrs = vec![attribute(cx, "allow", vec!["non_snake_case"]),
                         attribute(cx, "derive", traits)];

        let st = cx.item_struct(codemap::DUMMY_SP, name.clone(), def);
        cx.item(codemap::DUMMY_SP, name, attrs, st.node.clone()).map(|mut it| {
            it.vis = vis;
            it
        })
    }
/// Returns an item for the struct definition.
Returns an item for the struct definition.
Returns an item for the struct definition .
fn struct_decl(&self, cx: &ExtCtxt) -> P<ast::Item> {
        let name = self.struct_info.name.clone();
        let vis = if self.struct_info.public { ast::Public }
                  else { ast::Inherited };
        let def = ast::StructDef {
            fields: self.struct_fields(cx),
            ctor_id: None
        };
        let mut traits = vec!["RustcDecodable".to_string()];
        traits.push_all(self.struct_info.deriving.as_slice());
        let attrs = vec![attribute(cx, "allow", vec!["non_snake_case"]),
                         attribute(cx, "derive", traits)];
        let st = cx.item_struct(codemap::DUMMY_SP, name.clone(), def);
        cx.item(codemap::DUMMY_SP, name, attrs, st.node.clone()).map(|mut it| {
            it.vis = vis;
            it
        })
    }
fn struct_decl ( & self , cx : & ExtCtxt ) -> P < ast :: Item > { let name = self . struct_info . name . clone ( ) ; let vis = if self . struct_info . public { ast :: Public } else { ast :: Inherited } ; let def = ast :: StructDef { fields : self . struct_fields ( cx ) , ctor_id : None } ; let mut traits = vec ! [ " " to_string ( ) ] ; traits . push_all ( self . struct_info . deriving . as_slice ( ) ) ; let attrs = vec ! [ attribute ( cx " " vec [ " " ] ) attribute ( cx " " traits ) ] ; let st = cx . item_struct ( codemap :: DUMMY_SP , name . clone ( ) , def ) ; cx . item ( codemap :: DUMMY_SP , name , attrs , st . node . clone ( ) ) . map ( | mut it | { it . vis = vis ; it } ) }
Returns an item for the struct definition.
Returns an item for the struct definition .
&self
cx
&ExtCtxt
&self
cx
&ExtCtxt