title: How to create a macro that gets the value of an enum type?
body: <p>My enum looks like this:</p>
  
  <pre><code>#[derive(Clone, Debug)]
  pub enum Type {
      GLnull,
      GLenum(GLenum),
      GLboolean(GLboolean),
      GLint(GLint),
      GLbyte(GLbyte),
      GLshort(GLshort),
      GLclampx(GLclampx),
      GLubyte(GLubyte),
      GLushort(GLushort),
      GLuint(GLuint),
      GLsizei(GLsizei),
      GLclampf(GLclampf),
      GLdouble(GLdouble),
      GLclampd(GLclampd),
      GLfloat_4fv((GLfloat, GLfloat, GLfloat, GLfloat)),
      GLfloat(GLfloat),
      GLintptr(GLintptr),
      GLsizeiptr(GLsizeiptr),
      GLbitfield(GLbitfield),
      GLchar_ptr(String),
  }
  
  macro_rules! get{
      ($e:expr) =&gt; {
          match $e {
              Type::GLsizei(x) =&gt; { x }
              Type::GLbitfield(x) =&gt; { x }
              _ =&gt; { 0 }
          }
      }
  }
  </code></pre>
  
  <p>Now how do I create a macro that gets the value of the enum type?</p>