#[non_exhaustive]pub struct ApiError {
pub status: u16,
pub request_id: Option<RequestId>,
pub headers: HeaderMap,
pub error: ApiErrorBody,
pub raw_body: Option<String>,
}Expand description
EN: Error returned by OpenAI with HTTP and diagnostic context. 中文:包含 HTTP 与诊断上下文的 OpenAI 错误。
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.status: u16EN: HTTP response status. 中文:HTTP 响应状态码。
request_id: Option<RequestId>EN: OpenAI request id, when returned. 中文:OpenAI 请求 ID,如响应中存在。
headers: HeaderMapEN: Redacted diagnostic response headers. 中文:已脱敏的诊断响应头。
error: ApiErrorBodyEN: Structured OpenAI error fields. 中文:结构化 OpenAI 错误字段。
raw_body: Option<String>EN: Safe raw body copy, when retained. 中文:在安全时保留的原始响应体副本。
Trait Implementations§
impl Eq for ApiError
impl StructuralPartialEq for ApiError
Auto Trait Implementations§
impl Freeze for ApiError
impl RefUnwindSafe for ApiError
impl Send for ApiError
impl Sync for ApiError
impl Unpin for ApiError
impl UnsafeUnpin for ApiError
impl UnwindSafe for ApiError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.