docs: Add Rustdoc to handle_status function in server status API

Co-authored-by: aider (openai/andrew/openrouter/sonoma-sky-alpha) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-09-10 15:33:42 -03:00
parent 3df604e9bd
commit 6a79f0455c
2 changed files with 28 additions and 1 deletions

View File

@@ -279,7 +279,7 @@ Private helpers (e.g., internal `fn` without `pub`) are not flagged, as they don
- `ProgramWriter` struct: Partial.
- Impl `Write`: No doc.
52. **src/modes/server/api/status.rs**
52. **src/modes/server/api/status.rs** [DONE]
- `handle_status()` function: No doc.
53. **src/filter_plugin/tail.rs**

View File

@@ -22,6 +22,33 @@ use crate::modes::server::common::{AppState, StatusInfoResponse};
),
tag = "status"
)]
/// Axum handler for the /api/status GET endpoint.
///
/// Generates and returns comprehensive system status using the StatusService.
/// Includes paths, plugins, compression info, and configuration details.
///
/// # Arguments
///
/// * `State(state)` - The shared AppState containing settings, DB, and paths.
///
/// # Returns
///
/// * `Ok(Json<StatusInfoResponse>)` - Success response with status data.
/// * `Err(StatusCode)` - HTTP error status (e.g., 500 for internal errors; 401 if auth fails elsewhere).
///
/// # Errors
///
/// Returns StatusCode::INTERNAL_SERVER_ERROR if status generation panics or fails (current impl assumes success).
/// Auth errors are handled by middleware before reaching this handler.
///
/// # Examples
///
/// ```
/// // In an Axum app:
/// async fn app() -> Result<Json<StatusInfoResponse>, StatusCode> {
/// handle_status(State(app_state)).await
/// }
/// ```
pub async fn handle_status(
State(state): State<AppState>,
) -> Result<Json<StatusInfoResponse>, StatusCode> {