From 4e739291758682e702c69bb68ffff42b26cc36e2 Mon Sep 17 00:00:00 2001 From: kana-rus Date: Fri, 16 Feb 2024 05:03:36 +0900 Subject: [PATCH] Update: docs of .headers --- ohkami/src/request/mod.rs | 13 ++++++++----- ohkami/src/response/mod.rs | 11 +++++++---- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/ohkami/src/request/mod.rs b/ohkami/src/request/mod.rs index cadf203c..3a0bd05a 100644 --- a/ohkami/src/request/mod.rs +++ b/ohkami/src/request/mod.rs @@ -84,19 +84,22 @@ pub(crate) const PAYLOAD_LIMIT: usize = 1 << 32; /// ``` pub struct Request {pub(crate) _metadata: [u8; METADATA_SIZE], method: Method, - /// Headers of this request + /// Headers of this response /// /// - `.{Name}()` to get the value /// - `.set().{Name}(〜)` to mutate the value - /// - `.set().{Name}(append(〜))` to append + /// - `.set().{Name}({value})` to insert + /// - `.set().{Name}(None)` to remove + /// - `.set().{Name}(append({value}))` to append + /// + /// `{value}`: `String`, `&'static str`, `Cow<&'static, str>` /// /// --- /// - /// *`custom-header` feature required*: + /// *`custom-header` feature required* : /// /// - `.custom({Name})` to get the value - /// - `.set().custom({Name}, {value})` to mutate the value - /// - `.set().custom({Name}, append(〜))` to append + /// - `.set().custom({Name}, 〜)` to mutate the value like standard headers pub headers: RequestHeaders, pub(crate) path: Path, queries: QueryParams, diff --git a/ohkami/src/response/mod.rs b/ohkami/src/response/mod.rs index c225dcc4..e81deb0f 100644 --- a/ohkami/src/response/mod.rs +++ b/ohkami/src/response/mod.rs @@ -78,15 +78,18 @@ pub struct Response { /// /// - `.{Name}()` to get the value /// - `.set().{Name}(〜)` to mutate the value - /// - `.set().{Name}(append(〜))` to append + /// - `.set().{Name}({value})` to insert + /// - `.set().{Name}(None)` to remove + /// - `.set().{Name}(append({value}))` to append + /// + /// `{value}`: `String`, `&'static str`, `Cow<&'static, str>` /// /// --- /// - /// *`custom-header` feature required*: + /// *`custom-header` feature required* : /// /// - `.custom({Name})` to get the value - /// - `.set().custom({Name}, {value})` to mutate the value - /// - `.set().custom({Name}, append(〜))` to append + /// - `.set().custom({Name}, 〜)` to mutate the value like standard headers pub headers: ResponseHeaders, pub(crate) content: Option>, } const _: () = {