pub struct Response {
pub ok: Option<String>,
pub error_code: Option<String>,
pub error_message: Option<String>,
}Expand description
Generic success/error response
Fields§
§ok: Option<String>§error_code: Option<String>§error_message: Option<String>Implementations§
Source§impl Response
impl Response
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Check if the response indicates success
Sourcepub fn error_code(&self) -> Option<i32>
pub fn error_code(&self) -> Option<i32>
Get the error code as an integer
Sourcepub fn error_message(&self) -> Option<&str>
pub fn error_message(&self) -> Option<&str>
Get the error message
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Response
impl<'de> Deserialize<'de> for Response
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 Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnsafeUnpin for Response
impl UnwindSafe for Response
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