diff --git a/proxmox-api/src/const_regex.rs b/proxmox-api/src/const_regex.rs index 320a914b..9bcedbea 100644 --- a/proxmox-api/src/const_regex.rs +++ b/proxmox-api/src/const_regex.rs @@ -1,3 +1,9 @@ +//! Allow to build Regex within `const_fn` +//! +//! The current Regex::new() function is not `const_fn`. Unless that +//! works, we use a macro to generate something we can use inside +//! `const_fn`. + /// Macro to generate a ConstRegexPattern #[macro_export] macro_rules! const_regex { diff --git a/proxmox-api/src/error.rs b/proxmox-api/src/error.rs index d6fb4738..5385325d 100644 --- a/proxmox-api/src/error.rs +++ b/proxmox-api/src/error.rs @@ -5,6 +5,7 @@ use failure::Fail; #[doc(hidden)] pub use hyper::StatusCode; +/// HTTP error including `StatusCode` and message. #[derive(Debug, Fail)] pub struct HttpError { pub code: StatusCode, @@ -23,6 +24,7 @@ impl fmt::Display for HttpError { } } +/// Macro to create a HttpError inside a failure::Error #[macro_export] macro_rules! http_err { ($status:ident, $msg:expr) => {{ diff --git a/proxmox-api/src/lib.rs b/proxmox-api/src/lib.rs index 6cb8bc6a..98bc5328 100644 --- a/proxmox-api/src/lib.rs +++ b/proxmox-api/src/lib.rs @@ -10,9 +10,12 @@ use hyper::{Body, Response}; use serde_json::Value; pub mod const_regex; +#[doc(hidden)] pub mod error; pub mod format; +#[doc(hidden)] pub mod router; +#[doc(hidden)] pub mod rpc_environment; pub mod schema;