Macro observed_async_trait

Source
macro_rules! observed_async_trait {
    (impl $trait_name:ident for $target_type:ty {
		$(type $type_name:ident = $type:ty;)*
		$(async fn $method:ident(&$self:tt $(,$param_name:ident: $param_type:ty)* $(,)?) -> $res:ty $body:block)*
	}) => { ... };
}
Expand description

Logs each method invocation and each returned result. Has to be made at the level of trait, because otherwise #async_trait is expanded first. ‘&self’ matching yields “__self” identifier not found error, so “&$self:tt” is required. Works only if return type is Result.