mirror of
https://github.com/YGGverse/nexy.git
synced 2026-04-02 18:25:29 +00:00
give semantical names to response members
This commit is contained in:
parent
90b8b8c921
commit
23c9c1b96e
3 changed files with 53 additions and 36 deletions
|
|
@ -1,13 +1,19 @@
|
|||
/// Internal server response types
|
||||
pub enum Response<'a> {
|
||||
/// Includes reference to the original request
|
||||
AccessDenied(&'a str),
|
||||
/// Includes query + server-side error description
|
||||
InternalServerError(Option<&'a str>, String),
|
||||
/// Includes reference to the original request
|
||||
NotFound(&'a str),
|
||||
/// Includes bytes array
|
||||
AccessDenied {
|
||||
query: &'a str,
|
||||
},
|
||||
InternalServerError {
|
||||
query: Option<&'a str>,
|
||||
error: String,
|
||||
},
|
||||
NotFound {
|
||||
query: &'a str,
|
||||
},
|
||||
File(&'a [u8]),
|
||||
/// Includes query, list + is public root directory status
|
||||
Directory(&'a str, String, bool),
|
||||
Directory {
|
||||
query: &'a str,
|
||||
data: String,
|
||||
is_root: bool,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue