Skip to main content

dynoxide/
server_options.rs

1//! Startup options shared by the DynamoDB HTTP server and the MCP HTTP
2//! transport.
3//!
4//! Lives outside both server modules because either can be compiled without
5//! the other (`mcp-server` without `http-server` is a supported build).
6
7/// Options controlling the output of the DynamoDB HTTP server
8/// (`server::start_with_options`) and the MCP HTTP transport
9/// (`mcp::serve_http_with_options`).
10#[derive(Debug, Clone, Default)]
11pub struct ServerOptions {
12    suppress_informational_messages: bool,
13}
14
15impl ServerOptions {
16    /// Suppress informational server output: the listening lines and the
17    /// shutdown line. Warnings and errors still print.
18    pub const fn quiet() -> Self {
19        Self {
20            suppress_informational_messages: true,
21        }
22    }
23
24    pub(crate) const fn suppresses_informational_messages(&self) -> bool {
25        self.suppress_informational_messages
26    }
27}