Struct resty::Error
[−]
[src]
pub struct Error { pub code: StatusCode, pub message: String, pub details: String, }
API error format
Fields
code: StatusCode
Error code
message: String
Error message
details: String
Error details
Methods
impl Error
[src]
fn internal<A: Into<String>, B: Into<String>>(message: A, details: B) -> Self
[src]
Internal Server Error
fn not_found<T: Into<String>>(details: T) -> Self
[src]
Generate 404 not found error.
fn bad_request<A: Into<String>, B: Into<String>>(message: A, details: B) -> Self
[src]
Generate 400 bad request error.
fn method_not_allowed<A: Into<String>, B: Into<String>>(
message: A,
details: B
) -> Self
[src]
message: A,
details: B
) -> Self
Generate 405 method not allowed error.