From aca5a57460df49619b82d05dc7a75953e690dce5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dorian=20Pu=C5=82a?= Date: Fri, 23 Feb 2024 23:05:50 -0500 Subject: [PATCH] Add documentation of the main crate and first objects. --- src/main.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index ced23d1..967ab80 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,8 +1,4 @@ -#![warn(missing_docs)] - #![doc = include_str!("../README.md")] -/// ## Usage -/// use axum::{ extract::{Host, Json, OriginalUri}, @@ -16,6 +12,11 @@ use std::collections::BTreeMap; use tower_http::trace; use tracing::{info, warn, Level}; + +/// CLI arguments used by the [Parser]. +/// +/// Creates the usage and version information that is standard in a CLI +/// utility. #[derive(Parser)] #[command(author, version, about, long_about = None)] struct CliArgs { @@ -28,12 +29,18 @@ struct CliArgs { ips: String, } +/// The response consisting of the echoed request to the mirror-server. #[derive(Serialize, Deserialize, Debug, PartialEq)] struct EchoResponse { + /// The [Method] used in the request. method: String, + /// The path used in the request. path: String, + /// The original schema, hostname and port of the request. host: String, + /// The headers in the request. headers: BTreeMap, + /// (Optional) The JSON body in the request. #[serde(skip_serializing_if = "Option::is_none")] body: Option, }