pub enum SearchError {
Http(Error),
Json(Error),
Status(u16),
Api(String),
Captcha,
Payload(String),
InvalidConfig(String),
}Expand description
搜索或歌词获取过程中的错误。
Variants§
Http(Error)
网络请求失败:连接、超时、TLS,或响应体无法按目标类型解码(reqwest::Error)。
可用 reqwest::Error::is_timeout / is_connect / is_decode 进一步区分。
Json(Error)
响应文本不是合法 JSON(对响应文本调用 serde_json 时失败)。
Status(u16)
服务端返回了非成功状态码(4xx/5xx),例如 429 限流、401 凭证失效。
Api(String)
平台在 HTTP 成功响应里返回了业务层错误(如 QQ 音乐的 code != 0)。
Captcha
命中验证码风控(Musixmatch 401 + captcha hint),需要人工处理或更换配置。
Payload(String)
响应内容不符合预期格式(如 base64 / UTF-8 解码失败)。
InvalidConfig(String)
传入的配置非法。
Trait Implementations§
Source§impl Debug for SearchError
impl Debug for SearchError
Source§impl Display for SearchError
impl Display for SearchError
Source§impl Error for SearchError
impl Error for SearchError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<Error> for SearchError
impl From<Error> for SearchError
Source§fn from(error: Error) -> SearchError
fn from(error: Error) -> SearchError
Converts to this type from the input type.
Source§impl From<Error> for SearchError
impl From<Error> for SearchError
Source§fn from(error: Error) -> SearchError
fn from(error: Error) -> SearchError
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for SearchError
impl !UnwindSafe for SearchError
impl Freeze for SearchError
impl Send for SearchError
impl Sync for SearchError
impl Unpin for SearchError
impl UnsafeUnpin for SearchError
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.