#[non_exhaustive]pub enum RestError {
AuthError(AuthError),
Communication(Error),
Http(Error),
}Expand description
Represents errors that can occur during communication with the Spotify API.
This enum defines various error conditions that may arise while interacting with the Spotify API, such as authentication issues, HTTP errors, or communication failures.
This enum is marked as #[non_exhaustive], meaning new variants may be added
in future versions. When matching against it, include a wildcard arm (_)
to account for any future variants.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AuthError(AuthError)
An error related to setting the authentication header.
This variant wraps an AuthError that occurs when there is an issue
with the authorization process, such as an invalid state parameter
or a missing authorization code.
Communication(Error)
An error during communication with the Spotify API.
This variant wraps a reqwest::Error, which can occur due to network
connectivity issues, timeouts, or unexpected responses from the Spotify API.
Http(Error)
An error related to constructing or processing HTTP requests.
This variant wraps an http::Error, which can occur when handling HTTP
requests, such as invalid headers or improperly formed HTTP messages.
Trait Implementations§
Source§impl Error for RestError
impl Error for RestError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl Freeze for RestError
impl !RefUnwindSafe for RestError
impl Send for RestError
impl Sync for RestError
impl Unpin for RestError
impl !UnwindSafe for RestError
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
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.