macro_rules! _mut_switch { ($macro:tt $excl_mark:tt ( $($args:tt)+) ) => { $macro$excl_mark($($args)+); $macro$excl_mark($($args)+ mut); }; } macro_rules! _ctx_wrapper_constructor { ($name:ident) => { impl<'ctx, Ctx: NodeRefContainer> $name<&'ctx Ctx> { pub fn wrap(ctx: &'ctx Ctx) -> Self { return Self { ctx }; } } }; ($name:ident mut) => { impl<'ctx, Ctx: NodeRefContainer> $name<&'ctx mut Ctx> { pub fn wrap_mut(ctx: &'ctx mut Ctx) -> Self { return Self { ctx }; } } }; } macro_rules! _delegate_node_ref { ($name:ident $($mut:tt)?) => { impl NodeRefContainer for $name<& $($mut)? Ctx> { type NodeRef = Ctx::NodeRef; } }; } macro_rules! _delegate_parent_getter { ($name:ident $($mut:tt)?) => { impl BinaryTreeParentGetterContext for $name<& $($mut)? Ctx> { fn getParent(&self, node: Self::NodeRef) -> Option { return self.ctx.getParent(node); } } }; }