pub struct Error { /* private fields */ }
Expand description
General error type for the client. It is used to wrap all the possible errors that can occur.
Implementations§
Source§impl Error
impl Error
Sourcepub fn graphql_errors(&self) -> Option<&[GraphQlError]>
pub fn graphql_errors(&self) -> Option<&[GraphQlError]>
Original GraphQL query errors.
Sourcepub fn from_error<E: Into<Box<dyn Error + Send + Sync + 'static>>>(
kind: Kind,
error: E,
) -> Self
pub fn from_error<E: Into<Box<dyn Error + Send + Sync + 'static>>>( kind: Kind, error: E, ) -> Self
Convert the given error into a generic error.
Sourcepub fn empty_response_error() -> Self
pub fn empty_response_error() -> Self
Special constructor for queries that expect to return data but it’s none.
Sourcepub fn graphql_error(errors: Vec<GraphQlError>) -> Self
pub fn graphql_error(errors: Vec<GraphQlError>) -> Self
Create a Query kind of error with the original graphql errors.
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<AddressParseError> for Error
impl From<AddressParseError> for Error
Source§fn from(error: AddressParseError) -> Self
fn from(error: AddressParseError) -> Self
Converts to this type from the input type.
Source§impl From<DigestParseError> for Error
impl From<DigestParseError> for Error
Source§fn from(error: DigestParseError) -> Self
fn from(error: DigestParseError) -> Self
Converts to this type from the input type.
Source§impl From<ParseError> for Error
impl From<ParseError> for Error
Source§fn from(error: ParseError) -> Self
fn from(error: ParseError) -> Self
Converts to this type from the input type.
Source§impl From<ParseError> for Error
impl From<ParseError> for Error
Source§fn from(error: ParseError) -> Self
fn from(error: ParseError) -> Self
Converts to this type from the input type.
Source§impl From<ParseIntError> for Error
impl From<ParseIntError> for Error
Source§fn from(error: ParseIntError) -> Self
fn from(error: ParseIntError) -> Self
Converts to this type from the input type.
Source§impl From<TryFromIntError> for Error
impl From<TryFromIntError> for Error
Source§fn from(error: TryFromIntError) -> Self
fn from(error: TryFromIntError) -> Self
Converts to this type from the input type.
Source§impl From<TypeParseError> for Error
impl From<TypeParseError> for Error
Source§fn from(error: TypeParseError) -> Self
fn from(error: TypeParseError) -> Self
Converts to this type from the input type.
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§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
Casts
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read moreSource§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