pub struct RawResponse {
pub code: i32,
pub msg: String,
pub request_id: Option<String>,
pub data: Option<Value>,
pub error: Option<ErrorInfo>,
}Expand description
原始响应数据
Fields§
§code: i32响应代码
msg: String响应消息
request_id: Option<String>请求数据ID
data: Option<Value>额外数据
error: Option<ErrorInfo>错误信息
Implementations§
Source§impl RawResponse
impl RawResponse
Sourcepub fn success() -> RawResponse
pub fn success() -> RawResponse
创建成功响应
Sourcepub fn success_with_data(data: Value) -> RawResponse
pub fn success_with_data(data: Value) -> RawResponse
创建带数据的成功响应
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
检查是否成功
Trait Implementations§
Source§impl Clone for RawResponse
impl Clone for RawResponse
Source§fn clone(&self) -> RawResponse
fn clone(&self) -> RawResponse
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RawResponse
impl Debug for RawResponse
Source§impl Default for RawResponse
impl Default for RawResponse
Source§fn default() -> RawResponse
fn default() -> RawResponse
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for RawResponse
impl<'de> Deserialize<'de> for RawResponse
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RawResponse, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RawResponse, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for RawResponse
impl Serialize for RawResponse
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for RawResponse
impl RefUnwindSafe for RawResponse
impl Send for RawResponse
impl Sync for RawResponse
impl Unpin for RawResponse
impl UnsafeUnpin for RawResponse
impl UnwindSafe for RawResponse
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