pub struct BangumiError {
pub title: String,
pub details: BangumiErrordetails,
pub request_id: Option<String>,
pub description: String,
}Expand description
Bangumi 统一错误响应结构体
当 Bangumi 的 API 调用失败时,后端会返回该格式的错误信息。 该结构体可直接用于反序列化 JSON 错误响应,方便在客户端进行错误处理。
Fields§
§title: String错误的标题,用于快速定位问题类型 例如:“Unauthorized”、“ValidationError” 等
details: BangumiErrordetails详细的错误信息,包含具体的错误原因、请求路径和方法
request_id: Option<String>可选的请求 ID 用于在日志系统中追踪某一次具体的请求,便于调试和排查问题
description: String错误的详细描述,通常是一段可读性强的文字 用于向用户展示具体的错误原因或建议的解决方式
Trait Implementations§
Source§impl Clone for BangumiError
impl Clone for BangumiError
Source§fn clone(&self) -> BangumiError
fn clone(&self) -> BangumiError
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 BangumiError
impl Debug for BangumiError
Source§impl<'de> Deserialize<'de> for BangumiError
impl<'de> Deserialize<'de> for BangumiError
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 BangumiError
impl RefUnwindSafe for BangumiError
impl Send for BangumiError
impl Sync for BangumiError
impl Unpin for BangumiError
impl UnwindSafe for BangumiError
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