<#@ template cleanws="true" #> #[derive(Debug, PartialEq, Eq, Clone)] #[allow(non_camel_case_types)] pub enum Version { <# for v in &**self { #> <#= v.get_enum_name() #>, <# } #> Custom { platform: String, version: String, signature: Vec }, } impl Version { pub fn get_platform(&self) -> &str { match *self { <# for v in &**self { #> Version::<#= v.get_enum_name() #> => "<#= v.platform #>", <# } #> Version::Custom { ref platform, .. } => platform, } } pub fn get_version_string(&self) -> &str { match *self { <# for v in &**self { #> Version::<#= v.get_enum_name() #> => "<#= v.version #>", <# } #> Version::Custom { ref version, .. } => version, } } pub fn get_signature(&self) -> &[u8] { match *self { <# for v in &**self { #> Version::<#= v.get_enum_name() #> => &[<#= v.get_sign_array() #>], <# } #> Version::Custom { ref signature, .. } => signature, } } }