[−][src]Struct async_graphql::http::GQLError
Serializable error type
Methods from Deref<Target = Error>
pub fn backtrace(&self) -> &Backtrace
[src]
Get the backtrace for this Error.
Backtraces are only available on the nightly channel. Tracking issue: rust-lang/rust#53487.
In order for the backtrace to be meaningful, the environment variable
RUST_LIB_BACKTRACE=1
must be defined. Backtraces are somewhat
expensive to capture in Rust, so we don't necessarily want to be
capturing them all over the place all the time.
pub fn chain(&self) -> Chain
[src]
An iterator of the chain of source errors contained by this Error.
This iterator will visit every error in the cause chain of this error object, beginning with the error that this error object was created from.
Example
use anyhow::Error; use std::io; pub fn underlying_io_error_kind(error: &Error) -> Option<io::ErrorKind> { for cause in error.chain() { if let Some(io_error) = cause.downcast_ref::<io::Error>() { return Some(io_error.kind()); } } None }
pub fn root_cause(&self) -> &(dyn Error + 'static)
[src]
The lowest level cause of this error — this error's cause's cause's cause etc.
The root cause is the last error in the iterator produced by
[chain()
][Error::chain].
pub fn is<E>(&self) -> bool where
E: Display + Debug + Send + Sync + 'static,
[src]
E: Display + Debug + Send + Sync + 'static,
Returns true if E
is the type held by this error object.
For errors with context, this method returns true if E
matches the
type of the context C
or the type of the error on which the
context has been attached. For details about the interaction between
context and downcasting, see here.
pub fn downcast_ref<E>(&self) -> Option<&E> where
E: Display + Debug + Send + Sync + 'static,
[src]
E: Display + Debug + Send + Sync + 'static,
Downcast this error object by reference.
Example
// If the error was caused by redaction, then return a tombstone instead // of the content. match root_cause.downcast_ref::<DataStoreError>() { Some(DataStoreError::Censored(_)) => Ok(Poll::Ready(REDACTED_CONTENT)), None => Err(error), }
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for GQLError<'a>
impl<'a> Send for GQLError<'a>
impl<'a> Sync for GQLError<'a>
impl<'a> Unpin for GQLError<'a>
impl<'a> UnwindSafe for GQLError<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,