pub fn generate(&self) -> TokenStream {
		let constructor = self.constructor.as_ref().map(Constructor::generate);
		let functions: Vec<_> = self.functions.iter().map(Function::generate).collect();
		let events: Vec<_> = self.events.iter().map(Event::generate_event).collect();
		let logs: Vec<_> = self.events.iter().map(Event::generate_log).collect();
		quote! {
			use ethabi;
			const INTERNAL_ERR: &'static str = "`ethabi_derive` internal error";

			#constructor

			/// Contract's functions.
			pub mod functions {
				use super::INTERNAL_ERR;
				#(#functions)*
			}

			/// Contract's events.
			pub mod events {
				use super::INTERNAL_ERR;
				#(#events)*
			}

			/// Contract's logs.
			pub mod logs {
				use super::INTERNAL_ERR;
				use ethabi;
				#(#logs)*
			}
		}
	}
/// Generates rust interface for a contract.
Generates rust interface for a contract.
Generates rust interface for a contract .
pub fn generate(&self) -> TokenStream {
		let constructor = self.constructor.as_ref().map(Constructor::generate);
		let functions: Vec<_> = self.functions.iter().map(Function::generate).collect();
		let events: Vec<_> = self.events.iter().map(Event::generate_event).collect();
		let logs: Vec<_> = self.events.iter().map(Event::generate_log).collect();
		quote! {
			use ethabi;
			const INTERNAL_ERR: &'static str = "`ethabi_derive` internal error";
			#constructor
			/// Contract's functions.
			pub mod functions {
				use super::INTERNAL_ERR;
				#(#functions)*
			}
			/// Contract's events.
			pub mod events {
				use super::INTERNAL_ERR;
				#(#events)*
			}
			/// Contract's logs.
			pub mod logs {
				use super::INTERNAL_ERR;
				use ethabi;
				#(#logs)*
			}
		}
	}
pub fn generate ( & self ) -> TokenStream { let constructor = self . constructor . as_ref ( ) . map ( Constructor :: generate ) ; let functions : Vec < _ > = self . functions . iter ( ) . map ( Function :: generate ) . collect ( ) ; let events : Vec < _ > = self . events . iter ( ) . map ( Event :: generate_event ) . collect ( ) ; let logs : Vec < _ > = self . events . iter ( ) . map ( Event :: generate_log ) . collect ( ) ; quote ! { use ethabi const INTERNAL_ERR ' static str " " constructor /// Contract's functions. pub mod functions { use super INTERNAL_ERR ( functions ) } /// Contract's events. pub mod events { use super INTERNAL_ERR ( events ) } /// Contract's logs. pub mod logs { use super INTERNAL_ERR use ethabi ( logs ) } } }
Generates rust interface for a contract.
Generates rust interface for a contract .
&self