sonic_channel/
macroses.rs

1macro_rules! init_command {
2    (
3        $(#[$outer:meta])*
4        use $cmd_name:ident
5        for fn $fn_name:ident $(<$($lt:lifetime)+>)? (
6            $($arg_name:ident : $arg_type:ty $( => $arg_value:expr)?,)*
7        )
8        $(;)?
9    ) => {
10        $(#[$outer])*
11        pub fn $fn_name $(<$($lt)+>)? (
12            &self,
13            $($arg_name: $arg_type),*
14        ) -> $crate::result::Result<
15            <$cmd_name as $crate::commands::StreamCommand>::Response,
16        > {
17            let command = $cmd_name { $($arg_name $(: $arg_value)?,)* };
18            self.stream().run_command(command)
19        }
20    };
21}