fn items(&self, cx: &ExtCtxt) -> Box<MacResult+'static> {
        let mut its = vec!();
        its.push(self.struct_decl(cx));

        let struct_name = self.struct_info.name;
        let full_doc = self.doc.parser().full_doc.as_slice();
        its.push(quote_item!(cx,
            impl $struct_name {
                #[allow(dead_code)]
                fn docopt() -> docopt::Docopt {
                    // The unwrap is justified here because this code
                    // gen only happens if the Docopt usage string is valid.
                    docopt::Docopt::new($full_doc).unwrap()
                }
            }
        ).unwrap());
        MacItems::new(its.into_iter())
    }
/// Returns a macro result suitable for expansion.
/// Contains two items: one for the struct and one for the struct impls.
Returns a macro result suitable for expansion.
Contains two items: one for the struct and one for the struct impls.
Returns a macro result suitable for expansion . Contains two items : one for the struct and one for the struct impls .
fn items(&self, cx: &ExtCtxt) -> Box<MacResult+'static> {
        let mut its = vec!();
        its.push(self.struct_decl(cx));
        let struct_name = self.struct_info.name;
        let full_doc = self.doc.parser().full_doc.as_slice();
        its.push(quote_item!(cx,
            impl $struct_name {
                #[allow(dead_code)]
                fn docopt() -> docopt::Docopt {
                    // The unwrap is justified here because this code
                    // gen only happens if the Docopt usage string is valid.
                    docopt::Docopt::new($full_doc).unwrap()
                }
            }
        ).unwrap());
        MacItems::new(its.into_iter())
    }
fn items ( & self , cx : & ExtCtxt ) -> Box < MacResult + ' static > { let mut its = vec ! ( ) ; its . push ( self . struct_decl ( cx ) ) ; let struct_name = self . struct_info . name ; let full_doc = self . doc . parser ( ) . full_doc . as_slice ( ) ; its . push ( quote_item ! ( cx impl $ struct_name { [ allow ( dead_code ) ] fn docopt ( ) docopt Docopt { // The unwrap is justified here because this code // gen only happens if the Docopt usage string is valid. docopt Docopt new ( $ full_doc ) unwrap ( ) } } ) . unwrap ( ) ) ; MacItems :: new ( its . into_iter ( ) ) }
Returns a macro result suitable for expansion.
Returns a macro result suitable for expansion .
&self
cx
&ExtCtxt
&self
cx
&ExtCtxt