removed the traits so this thing works
This commit is contained in:
16
src/lib.rs
16
src/lib.rs
@ -1,22 +1,8 @@
|
||||
use async_trait::async_trait;
|
||||
use proc_macro::TokenStream;
|
||||
use quote::quote;
|
||||
use syn::{parse_macro_input, ItemEnum, Lit, DeriveInput, Fields, Data};
|
||||
|
||||
#[async_trait]
|
||||
pub trait Queryable {
|
||||
///send the query types query and get the response returned as the
|
||||
///proper response type
|
||||
pub fn send(
|
||||
&self,
|
||||
base_url: &str,
|
||||
headers: Option<Vec<(&str, &str)>>,
|
||||
) -> Result<Response, std::io::Error>;
|
||||
}
|
||||
|
||||
pub trait Responsable {
|
||||
pub fn receive(resp: Response) -> Result<Self, std::error::Error>;
|
||||
}
|
||||
|
||||
#[proc_macro_derive(HttpRequest, attributes(http_get))]
|
||||
pub fn derive_http_get_request(input: TokenStream) -> TokenStream {
|
||||
let input = parse_macro_input!(input as DeriveInput);
|
||||
|
Reference in New Issue
Block a user