pub struct Reply {
pub status: u16,
pub body: Value,
pub text: String,
}Expand description
One answer from the API, with NO judgement about its status. The callers
decide what a code means, because they genuinely disagree: a 404 on
GET /server/{uuid} is a FACT for a sweep and a REFUSAL for a resize. A
transport failure is the Err and is never a status.
Fields§
§status: u16§body: ValueThe body as JSON; Null when it was empty or not JSON.
text: StringThe body exactly as it arrived, so a non-JSON error page from a proxy reaches the operator intact instead of becoming a parse error that names nothing.
Implementations§
Source§impl Reply
impl Reply
pub fn ok(&self) -> bool
Sourcepub fn error_code(&self) -> &str
pub fn error_code(&self) -> &str
error.error_code, or "".
Sourcepub fn error_message(&self) -> &str
pub fn error_message(&self) -> &str
error.error_message, or the raw text.
Sourcepub fn describe_failure(&self, what: &str) -> String
pub fn describe_failure(&self, what: &str) -> String
409 SERVER_STATE_ILLEGAL — server state is started: status, code and
message, because each answers a different question.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Reply
impl RefUnwindSafe for Reply
impl Send for Reply
impl Sync for Reply
impl Unpin for Reply
impl UnsafeUnpin for Reply
impl UnwindSafe for Reply
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more