Struct async_graphql::Error
source · [−]pub struct Error {
pub message: String,
pub source: Option<Arc<dyn Any + Send + Sync>>,
pub extensions: Option<ErrorExtensionValues>,
}
Expand description
An error with a message and optional extensions.
Fields
message: String
The error message.
source: Option<Arc<dyn Any + Send + Sync>>
The source of the error.
extensions: Option<ErrorExtensionValues>
Extensions to the error.
Implementations
sourceimpl Error
impl Error
sourcepub fn new_with_source(source: impl Display + Send + Sync + 'static) -> Self
pub fn new_with_source(source: impl Display + Send + Sync + 'static) -> Self
Create an error with a type that implements Display
, and it will also
set the source
of the error to this value.
sourcepub fn into_server_error(self, pos: Pos) -> ServerError
pub fn into_server_error(self, pos: Pos) -> ServerError
Convert the error to a server error.
Trait Implementations
sourceimpl ErrorExtensions for Error
impl ErrorExtensions for Error
sourcefn extend_with<C>(self, cb: C) -> Errorwhere
C: FnOnce(&Self, &mut ErrorExtensionValues),
fn extend_with<C>(self, cb: C) -> Errorwhere
C: FnOnce(&Self, &mut ErrorExtensionValues),
Add extensions to the error, using a callback to make the extensions.
Auto Trait Implementations
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more