pub struct Error { /* private fields */ }Expand description
Represents errors that can occur while communicating with the VTube Studio API.
Implementations§
Source§impl Error
impl Error
Sourcepub fn to_api_error(&self) -> Option<&ApiError>
pub fn to_api_error(&self) -> Option<&ApiError>
Returns the underlying ApiError, if any.
Sourcepub fn with_source<E: Into<BoxError>>(self, source: E) -> Self
pub fn with_source<E: Into<BoxError>>(self, source: E) -> Self
Sets this error’s underlying source.
Sourcepub fn into_source(self) -> Option<Box<dyn StdError + Send + Sync>>
pub fn into_source(self) -> Option<Box<dyn StdError + Send + Sync>>
Consumes the error, returning its source.
Sourcepub fn is_api_error(&self) -> bool
pub fn is_api_error(&self) -> bool
Returns true if this error has an underlying ApiError.
Sourcepub fn is_unauthenticated_error(&self) -> bool
pub fn is_unauthenticated_error(&self) -> bool
Returns true if this error’s underlying ApiError is an authentication error.
Sourcepub fn from_boxed(error: BoxError) -> Self
pub fn from_boxed(error: BoxError) -> Self
Converts a BoxError into this error type. If the underlying Error
is not this error type, a new Error is created with ErrorKind::Other.
Sourcepub fn has_kind(&self, kind: ErrorKind) -> bool
pub fn has_kind(&self, kind: ErrorKind) -> bool
Checks if any error in this error’s source chain matches the given ErrorKind.
Sourcepub fn find_source<E: StdError + 'static>(&self) -> Option<&E>
pub fn find_source<E: StdError + 'static>(&self) -> Option<&E>
Recurses through this error’s source chain, returning the first matching error type.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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<UnexpectedResponseError> for Error
impl From<UnexpectedResponseError> for Error
Source§fn from(error: UnexpectedResponseError) -> Self
fn from(error: UnexpectedResponseError) -> Self
Converts to this type from the input type.
Source§impl Policy<RequestEnvelope, ResponseEnvelope, Error> for RetryPolicy
impl Policy<RequestEnvelope, ResponseEnvelope, Error> for RetryPolicy
Source§type Future = Ready<RetryPolicy>
type Future = Ready<RetryPolicy>
The
Future type returned by Policy::retry.Source§fn retry(
&self,
req: &RequestEnvelope,
result: Result<&ResponseEnvelope, &Error>,
) -> Option<Self::Future>
fn retry( &self, req: &RequestEnvelope, result: Result<&ResponseEnvelope, &Error>, ) -> Option<Self::Future>
Check the policy if a certain request should be retried. Read more
Source§fn clone_request(&self, req: &RequestEnvelope) -> Option<RequestEnvelope>
fn clone_request(&self, req: &RequestEnvelope) -> Option<RequestEnvelope>
Tries to clone a request before being passed to the inner service. Read more
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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