pub struct ErrorEnvelope {
pub code_key: Option<String>,
pub ok_codes: Vec<String>,
pub message_key: String,
}Expand description
The fields that carry an error in a successful (HTTP 200) venue reply.
With code_key, the reply is an error when that field is present and its
value is not in ok_codes. Without it, the reply is an error when
message_key holds a non-empty string or array (Kraken’s error: [...]).
Fields§
§code_key: Option<String>Field with the status code (e.g. retCode). A missing field means success.
ok_codes: Vec<String>Code values that mean success, compared as strings (e.g. "0").
message_key: StringField with the venue’s error message (e.g. retMsg).
Implementations§
Source§impl ErrorEnvelope
impl ErrorEnvelope
Sourcepub fn error_message(&self, reply: &Value) -> Option<String>
pub fn error_message(&self, reply: &Value) -> Option<String>
The venue’s error message, or None when the reply is not an error.
Trait Implementations§
Source§impl Clone for ErrorEnvelope
impl Clone for ErrorEnvelope
Source§impl Debug for ErrorEnvelope
impl Debug for ErrorEnvelope
Source§impl<'de> Deserialize<'de> for ErrorEnvelope
impl<'de> Deserialize<'de> for ErrorEnvelope
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ErrorEnvelope
impl RefUnwindSafe for ErrorEnvelope
impl Send for ErrorEnvelope
impl Sync for ErrorEnvelope
impl Unpin for ErrorEnvelope
impl UnsafeUnpin for ErrorEnvelope
impl UnwindSafe for ErrorEnvelope
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