feat: add native call

This commit is contained in:
Kingtous
2023-04-28 13:46:43 +08:00
parent 3774f8308f
commit c140bcfed6
4 changed files with 159 additions and 30 deletions
+27
View File
@@ -0,0 +1,27 @@
#[macro_export]
macro_rules! return_if_not_method {
($call: ident, $prefix: ident) => {
if $call.starts_with($prefix) {
return None;
}
};
}
#[macro_export]
macro_rules! call_if_method {
($call: ident ,$method: literal, $block: block) => {
if ($call != $method) {
$block
}
};
}
#[macro_export]
macro_rules! define_method_prefix {
($prefix: literal) => {
#[inline]
fn method_prefix(&self) -> &'static str {
$prefix
}
};
}