diff --git a/macros/Cargo.toml b/macros/Cargo.toml index 7407106..b76843a 100644 --- a/macros/Cargo.toml +++ b/macros/Cargo.toml @@ -2,6 +2,12 @@ name = "leptos_reactive_axum_macros" version = "0.1.0" edition = "2021" +description = "reactive context for axum handlers" +authors = ["davidontop "] +readme = "../README.md" +documentation = "https://docs.rs/leptos_reactive_axum_macros" +license = "MIT" +repository = "https://git.davidon.top/public/leptos_reactive_axum.git" [lib] proc-macro = true diff --git a/macros/src/lib.rs b/macros/src/lib.rs index 06b0557..a54e9a7 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -1,5 +1,6 @@ mod reactive; +/// macro that when applied on an axum handler will provide leptos_reactive runtime and will allow you to use `leptos_reactive_axum::extract` by providing a context holding request parts #[proc_macro_attribute] pub fn reactive( attr: proc_macro::TokenStream, diff --git a/src/lib.rs b/src/lib.rs index 1a2aad5..22cc5cf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,6 +6,7 @@ use axum::{extract::FromRequestParts, http::request::Parts}; use error::ExtractionError; pub use leptos_reactive_axum_macros::reactive; +/// used to extract request parts from handlers, should be used in conjunction with `leptos_reactive_axum_macros::reactive macro` pub async fn extract() -> Result where T: FromRequestParts<()>, @@ -14,6 +15,7 @@ where extract_with_state::(&()).await } +/// used to extract request parts from handlers with state, should be used in conjunction with `leptos_reactive_axum_macros::reactive macro` pub async fn extract_with_state(state: &S) -> Result where T: FromRequestParts,