pub fn gen_ops_enum(&mut self) {
        let ops_names: Vec<Ident> = self.ops.values().map(|op| op.unwrap().ident()).collect();

        self.write_code(quote! {

            #[derive(Debug, PartialEq, Eq, Clone, Copy)]
            pub enum S3Ops {
                #(#ops_names),*
            }

            /// This macro calls a provided $macro for each S3 operation to generate code per op.
            macro_rules! generate_code_for_each_s3_op {
                ($macro:ident) => {
                    #( $macro!(#ops_names); )*
                }
            }

            /// This macro matches a variable of S3Ops type and expands the provided $macro
            /// for each S3 operation to generate code handler per op.
            macro_rules! generate_match_for_each_s3_op {
                ($macro:ident, $op:expr) => {
                    match ($op) {
                        #( S3Ops::#ops_names => $macro!(#ops_names), )*
                    }
                }
            }

            pub(crate) use generate_code_for_each_s3_op;
            pub(crate) use generate_match_for_each_s3_op;

        });
    }
/// Generate the basic enum of operation kinds + macros to quickly generate code for each operation.
/// The enum is flat - meaning it defines no attached state to any of the operations.
/// It might be interesting to consider a more complex enum if needed by the daemon,
/// or perhaps that would instead go to it's own enum, with auto-generated-mapping to this one.
Generate the basic enum of operation kinds + macros to quickly generate code for each operation.
The enum is flat - meaning it defines no attached state to any of the operations.
It might be interesting to consider a more complex enum if needed by the daemon,
or perhaps that would instead go to it's own enum, with auto-generated-mapping to this one.
Generate the basic enum of operation kinds + macros to quickly generate code for each operation . The enum is flat - meaning it defines no attached state to any of the operations . It might be interesting to consider a more complex enum if needed by the daemon or perhaps that would instead go to it ' s own enum with auto - generated - mapping to this one .
pub fn gen_ops_enum(&mut self) {
        let ops_names: Vec<Ident> = self.ops.values().map(|op| op.unwrap().ident()).collect();
        self.write_code(quote! {
            #[derive(Debug, PartialEq, Eq, Clone, Copy)]
            pub enum S3Ops {
                #(#ops_names),*
            }
            /// This macro calls a provided $macro for each S3 operation to generate code per op.
            macro_rules! generate_code_for_each_s3_op {
                ($macro:ident) => {
                    #( $macro!(#ops_names); )*
                }
            }
            /// This macro matches a variable of S3Ops type and expands the provided $macro
            /// for each S3 operation to generate code handler per op.
            macro_rules! generate_match_for_each_s3_op {
                ($macro:ident, $op:expr) => {
                    match ($op) {
                        #( S3Ops::#ops_names => $macro!(#ops_names), )*
                    }
                }
            }
            pub(crate) use generate_code_for_each_s3_op;
            pub(crate) use generate_match_for_each_s3_op;
        });
    }
pub fn gen_ops_enum ( & mut self ) { let ops_names : Vec < Ident > = self . ops . values ( ) . map ( | op | op . unwrap ( ) . ident ( ) ) . collect ( ) ; self . write_code ( quote ! { [ derive ( Debug PartialEq Eq Clone Copy ) ] pub enum S3Ops { ( ops_names ) } /// This macro calls a provided $macro for each S3 operation to generate code per op. macro_rules generate_code_for_each_s3_op { ( $ macro ident ) { ( $ macro ( ops_names ) ) } } /// This macro matches a variable of S3Ops type and expands the provided $macro /// for each S3 operation to generate code handler per op. macro_rules generate_match_for_each_s3_op { ( $ macro ident $ op expr ) { match ( $ op ) { ( S3Ops ops_names $ macro ( ops_names ) ) } } } pub ( crate ) use generate_code_for_each_s3_op pub ( crate ) use generate_match_for_each_s3_op } ) ; }
Generate the basic enum of operation kinds + macros to quickly generate code for each operation.
Generate the basic enum of operation kinds + macros to quickly generate code for each operation .
&mut self
&mut self