[ 
https://issues.apache.org/jira/browse/THRIFT-2945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15863010#comment-15863010
 ] 

Tony Przygienda commented on THRIFT-2945:
-----------------------------------------

understood, I'm commenting purely in Rust context here and Rust code 
generation. I didn't touch the Thrift compiler meta code, it's golden, in fact 
great code very easy to get one's head around ... 

As well, I implemented additionally on the branch macro generation for 
struct/union/enum which will convienently allow the application to derive 
further traits via e.g. Rust macros, example 

macro_rules! ENUM_MEMBERS_OPERATION { () => 
  {
    ADD = 1,
    SUBTRACT = 2,
    MULTIPLY = 3,
    DIVIDE = 4,
  }
}
///You can define enums, which are just 32 bit integers. Values are optional
///and start at 1 if not supplied, C style again.
#[derive(Copy, Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Hash)]
pub enum Operation {
  ADD = 1,
  SUBTRACT = 2,
  MULTIPLY = 3,
  DIVIDE = 4,
}

will allow via ENUM_MEMBERS_OPERATION!() invocation to obtain the list of all 
names of enum members with values (analogous struct,enum) and write according 
macros of it ... Extremely useful for traits, since then one can just macroize 
traits out per each Thrift type in case the specific fields/types/values are 
needed ... Mind-bendingly powerful ... 

> Implement support for Rust language
> -----------------------------------
>
>                 Key: THRIFT-2945
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2945
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Rust - Compiler, Rust - Library
>            Reporter: Maksim Golov
>            Assignee: Allen George
>             Fix For: 0.11.0
>
>
> Work on implementing support for Rust is in progress: 
> https://github.com/maximg/thrift by Simon Génier and myself.
> It will probably take quite some time to complete. Please keep us updated if 
> there are changes related to our work.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to