| Crates.io | partial-bind |
| lib.rs | partial-bind |
| version | 0.1.0 |
| created_at | 2025-08-30 19:22:18.611886+00 |
| updated_at | 2025-08-30 19:22:18.611886+00 |
| description | A simple proc-macro library that provides a macro to partial bind function arguments using closures. |
| homepage | |
| repository | https://github.com/ZXY595/partial-bind |
| max_upload_size | |
| id | 1817889 |
| size | 6,489 |
A simple proc-macro library that provides a macro to partial bind function arguments using closures. Which is known as partial function application.
bind!(foo(1, 2, _, _, 3)); // which generates: |__1, __2| foo(1, 2, __1, __2, 3)
let (tx, rx) = async_channel::unbounded();
tokio::spawn(async move {tx.send(1).await.unwrap()});
router.route("/api/1", get(bind!(handler(rx))))
async fn handler(rx: async_channel::Receiver<i32>) -> i32 {
rx.recv().await.unwrap()
}