pincer-macro

Crates.iopincer-macro
lib.rspincer-macro
version0.1.1
created_at2025-12-31 13:36:27.060025+00
updated_at2025-12-31 18:03:37.931557+00
descriptionProcedural macros for pincer declarative HTTP client
homepage
repositoryhttps://github.com/ilaborie/pincer
max_upload_size
id2014703
size121,380
igor (ilaborie)

documentation

README

pincer-macro

Crates.io docs.rs License

Proc-macros for the pincer HTTP client.

Overview

This crate provides the proc-macro attributes:

  • #[pincer] - Define an API client trait
  • #[get], #[post], #[put], #[delete], #[patch], #[head], #[options] - HTTP methods
  • #[http] - Custom HTTP methods
  • #[derive(Query)] - Query parameter serialization

Usage

Most users should use the main pincer crate, which re-exports these macros.

use pincer::prelude::*;

#[pincer(url = "https://api.example.com")]
pub trait MyApi {
    #[get("/users/{id}")]
    async fn get_user(&self, #[path] id: u64) -> pincer::Result<User>;
}

License

MIT OR Apache-2.0

Commit count: 0

cargo fmt