Macro define_algorithm_and_builder
Source macro_rules! define_algorithm_and_builder {
(
$(#[$meta:meta])*
$algorithm:ident, $selector:ty, $survivor:ty
$(, selection_args = [ $( $larg:ident : $lty:ty ),* $(,)? ])?
$(, survival_args = [ $( $sarg:ident : $sty:ty ),* $(,)? ])?
$(, shared_survival_args = [ $( $ss:ident : $ssty:ty ),* $(,)? ])?
, override_build_method = $ov:tt
$(,)?
) => { ... };
(
$(#[$meta:meta])*
$algorithm:ident, $selector:ty, $survivor:ty
$(, selection_args = [ $( $larg:ident : $lty:ty ),* $(,)? ])?
$(, survival_args = [ $( $sarg:ident : $sty:ty ),* $(,)? ])?
$(, shared_survival_args = [ $( $ss:ident : $ssty:ty ),* $(,)? ])?
$(,)? // trailing comma opcional
) => { ... };
(@impl
($(#[$meta:meta])*) $algorithm:ident, $selector:ty, $survivor:ty,
selection: [ $( $larg:ident : $lty:ty ),* ],
survival: [ $( $sarg:ident : $sty:ty ),* ],
shared: [ $( $ss:ident : $ssty:ty ),* ],
override_build: $ov:tt
) => { ... };
(@call_selector $ty:ty ; () ) => { ... };
(@call_selector $ty:ty ; ( $( $a:ident ),+ ) ) => { ... };
(@call_survivor $ty:ty ; () () ) => { ... };
(@call_survivor $ty:ty ; ( $( $a:ident ),+ ) () ) => { ... };
(@call_survivor $ty:ty ; () ( $( $b:ident ),+ ) ) => { ... };
(@call_survivor $ty:ty ; ( $( $a:ident ),+ ) ( $( $b:ident ),+ ) ) => { ... };
}