pub struct ApiErrorResponse {
pub code: u32,
pub message: String,
pub request_id: Option<String>,
}Expand description
Detailed API error response from Alpaca.
Fields§
§code: u32The error code returned by Alpaca.
message: StringThe error message.
request_id: Option<String>Optional request ID for debugging.
Implementations§
Source§impl ApiErrorResponse
impl ApiErrorResponse
Sourcepub fn new(code: u32, message: impl Into<String>) -> ApiErrorResponse
pub fn new(code: u32, message: impl Into<String>) -> ApiErrorResponse
Creates a new API error response.
Sourcepub fn with_request_id(self, request_id: impl Into<String>) -> ApiErrorResponse
pub fn with_request_id(self, request_id: impl Into<String>) -> ApiErrorResponse
Sets the request ID.
Sourcepub fn error_code(&self) -> ApiErrorCode
pub fn error_code(&self) -> ApiErrorCode
Returns the typed error code.
Trait Implementations§
Source§impl Clone for ApiErrorResponse
impl Clone for ApiErrorResponse
Source§fn clone(&self) -> ApiErrorResponse
fn clone(&self) -> ApiErrorResponse
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 ApiErrorResponse
impl Debug for ApiErrorResponse
Source§impl<'de> Deserialize<'de> for ApiErrorResponse
impl<'de> Deserialize<'de> for ApiErrorResponse
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ApiErrorResponse, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ApiErrorResponse, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ApiErrorResponse
impl Serialize for ApiErrorResponse
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 ApiErrorResponse
impl RefUnwindSafe for ApiErrorResponse
impl Send for ApiErrorResponse
impl Sync for ApiErrorResponse
impl Unpin for ApiErrorResponse
impl UnwindSafe for ApiErrorResponse
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