waveless_commons/http_executor/request_cx.rs
1// Waveless
2// Copyright (C) 2026 Oscar Alvarez Gonzalez
3
4use crate::*;
5
6use endpoint::*;
7
8/// TODO: add docs.
9#[derive(Getters, MutGetters, Debug)]
10#[getset(get = "pub", get_mut = "pub")]
11pub struct RequestCx {
12 /// NOTE: make sure not to consume the request body if you want a streaming request.
13 pub request: Request<BoxBody<ConnBytes, eyre::Error>>,
14 pub method: HttpMethod,
15 pub request_params: HashMap<CompactString, ParamValue>,
16 pub endpoint: Endpoint,
17}
18
19/// Defines whether a request parameter came from the client or was injected by the runtime.
20/// NOTE: request params from the client will be overwriten by the executor if they have the same key.
21/// TODO: fix the previous behaviour?
22#[derive(Clone, Debug)]
23pub enum ParamValue {
24 Internal(CompactString),
25 Client(Option<CompactString>),
26}