observed_async_trait

Macro observed_async_trait 

Source
macro_rules! observed_async_trait {
    (impl $(<$($type_param:tt),+>)? $trait_name:ident $(<$($type_arg:ident),+>)? for $target_type:ty
		$(where $($where_type:ident : $where_bound:tt ,)+)?

		{
		$(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.