mirror of
https://git.proxmox.com/git/proxmox
synced 2025-08-07 15:26:55 +00:00
proxmox-api/src/lib.rs: hide modules with inlined docs
This commit is contained in:
parent
edb41c1929
commit
fa83cbde13
@ -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 to generate a ConstRegexPattern
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! const_regex {
|
macro_rules! const_regex {
|
||||||
|
@ -5,6 +5,7 @@ use failure::Fail;
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub use hyper::StatusCode;
|
pub use hyper::StatusCode;
|
||||||
|
|
||||||
|
/// HTTP error including `StatusCode` and message.
|
||||||
#[derive(Debug, Fail)]
|
#[derive(Debug, Fail)]
|
||||||
pub struct HttpError {
|
pub struct HttpError {
|
||||||
pub code: StatusCode,
|
pub code: StatusCode,
|
||||||
@ -23,6 +24,7 @@ impl fmt::Display for HttpError {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Macro to create a HttpError inside a failure::Error
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! http_err {
|
macro_rules! http_err {
|
||||||
($status:ident, $msg:expr) => {{
|
($status:ident, $msg:expr) => {{
|
||||||
|
@ -10,9 +10,12 @@ use hyper::{Body, Response};
|
|||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
|
|
||||||
pub mod const_regex;
|
pub mod const_regex;
|
||||||
|
#[doc(hidden)]
|
||||||
pub mod error;
|
pub mod error;
|
||||||
pub mod format;
|
pub mod format;
|
||||||
|
#[doc(hidden)]
|
||||||
pub mod router;
|
pub mod router;
|
||||||
|
#[doc(hidden)]
|
||||||
pub mod rpc_environment;
|
pub mod rpc_environment;
|
||||||
pub mod schema;
|
pub mod schema;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user