#![cfg_attr(docsrs, feature(doc_auto_cfg))]
pub mod config;
pub mod error;
pub use config::{ConfigError, ServerConfig};
pub use error::{BoxError, Error, OptionExt, Result, ResultExt};
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum ServerError {
#[error("invalid listen address `{address}`: {reason}")]
InvalidAddress {
address: String,
reason: String,
},
#[error("failed to bind to `{address}`: {source}")]
Bind {
address: String,
#[source]
source: std::io::Error,
},
#[error(
"`run_blocking` cannot be called from inside a Tokio runtime (it would create a nested \
runtime). Inside `#[tokio::main]` or any async context, use `app.run(addr).await` instead"
)]
NestedRuntime,
#[error("failed to build the Tokio runtime: {0}")]
Runtime(#[source] std::io::Error),
#[error("server I/O error: {0}")]
Io(#[from] std::io::Error),
}