context_manager 0.1.3

Python's like context_managers in Rust
Documentation
use context_manager::AsyncWrapContext;
use context_manager_macro::async_wrap;
use std::fmt::Debug;

struct Async;
impl<T> AsyncWrapContext<T> for Async {
    async fn new() -> Self {
        Self
    }
}

#[async_wrap(Async)]
fn sync_foo<'a, T: Debug>(v: &'a T) -> String {
    format!("{:?}", v)
}

fn main() {
    assert_eq!(sync_foo(&10), "10");
}