Skip to content

Commit

Permalink
Update: docs of .headers
Browse files Browse the repository at this point in the history
  • Loading branch information
kanarus committed Feb 15, 2024
1 parent 93cd16c commit 4e73929
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
13 changes: 8 additions & 5 deletions ohkami/src/request/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 7 additions & 4 deletions ohkami/src/response/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Cow<'static, [u8]>>,
} const _: () = {
Expand Down

0 comments on commit 4e73929

Please sign in to comment.