http_request/request/request_builder/
struct.rs

1use crate::*;
2
3/// Builder pattern for constructing `HttpRequest` instances.
4///
5/// The `RequestBuilder` struct facilitates the creation of `HttpRequest` objects
6/// through a series of method calls. It allows for flexible and clear configuration of
7/// an HTTP request's components such as method, URL, headers, and body.
8///
9/// # Fields
10/// - `http_request`: A temporary `HttpRequest` instance used to accumulate changes during
11///   the construction process. It holds the current state of the builder.
12/// - `builder`: A finalized `HttpRequest` instance that holds the result after the
13///   builder process has been completed. It is returned when the builder is finalized.
14///
15/// This builder simplifies the creation of `HttpRequest` objects, ensuring thread-safety
16/// and immutability of shared references, while providing a fluent API for constructing
17/// HTTP requests with various configurations.
18#[derive(Debug, Clone, Default)]
19pub struct RequestBuilder {
20    pub(crate) http_request: HttpRequest,
21    pub(crate) builder: HttpRequest,
22}