overloadable_member!() { /* proc-macro */ }
Expand description
Overloadable function macro for members. This allows you to have overloadable methods and associated functions.
This has similar syntax to that of overloadable
, except that it differs in that
the function name must be preceded by StructName::
, for example:
struct Foo;
overloadable::overloadable_member!{
Foo::func_name as
fn() {},
fn(self) {},
fn(mut self, x: isize) {},
fn(&self, y: usize) {},
fn(self: Box<Self>, z: &str) {}
}
** NOTE **
This is internally implemented using custom traits, so to have this functionality
carry over, you must use a use my_mod::*
to import all of the traits defined by
this macro.