pub struct Error { /* private fields */ }Expand description
Error
Public error payload.
Implementations§
Source§impl Error
impl Error
Sourcepub const fn from_code(code: DiagnosticCode, origin: ErrorOrigin) -> Self
pub const fn from_code(code: DiagnosticCode, origin: ErrorOrigin) -> Self
Build a compact public error from one diagnostic code and origin.
Sourcepub const fn from_error_code(code: ErrorCode, origin: ErrorOrigin) -> Self
pub const fn from_error_code(code: ErrorCode, origin: ErrorOrigin) -> Self
Build a public error from one numeric wire code and origin.
Sourcepub const fn from_kind(kind: ErrorKind, origin: ErrorOrigin) -> Self
pub const fn from_kind(kind: ErrorKind, origin: ErrorOrigin) -> Self
Build a compact public error from one public category and origin.
This helper keeps generated endpoint code concise while the wire payload itself remains code/detail-first.
Sourcepub const fn from_runtime_boundary(
boundary: RuntimeBoundaryCode,
origin: ErrorOrigin,
) -> Self
pub const fn from_runtime_boundary( boundary: RuntimeBoundaryCode, origin: ErrorOrigin, ) -> Self
Build a compact public runtime-boundary error.
Sourcepub fn from_diagnostic(diagnostic: Diagnostic) -> Self
pub fn from_diagnostic(diagnostic: Diagnostic) -> Self
Build a compact public error from a full diagnostic payload.
Sourcepub const fn class(&self) -> ErrorClass
pub const fn class(&self) -> ErrorClass
Return the broad compact diagnostic class.
Sourcepub const fn origin(&self) -> ErrorOrigin
pub const fn origin(&self) -> ErrorOrigin
Return the diagnostic origin.
Sourcepub fn diagnostic(&self) -> Diagnostic
pub fn diagnostic(&self) -> Diagnostic
Return compact diagnostic identity for this error.
Sourcepub const fn diagnostic_code(&self) -> DiagnosticCode
pub const fn diagnostic_code(&self) -> DiagnosticCode
Return the compact diagnostic code for this error.
Sourcepub const fn facts(&self) -> &[DiagnosticFact]
pub const fn facts(&self) -> &[DiagnosticFact]
Borrow the bounded numeric facts carried by this error.
Sourcepub const fn query_field(&self) -> Option<&QueryFieldDiagnostic>
pub const fn query_field(&self) -> Option<&QueryFieldDiagnostic>
Borrow the raw optional query-field context.
Sourcepub fn validated_query_field(
&self,
) -> Result<Option<(QueryFieldRole, &str)>, QueryFieldSchemaMismatch>
pub fn validated_query_field( &self, ) -> Result<Option<(QueryFieldRole, &str)>, QueryFieldSchemaMismatch>
Validate and borrow the optional query-field context.
Decoded client data remains untrusted until this check succeeds.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Error
impl<'de> Deserialize<'de> for Error
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · 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
use the Display impl or to_string()
Source§impl From<DatabaseBootstrapError> for Error
impl From<DatabaseBootstrapError> for Error
Source§fn from(err: DatabaseBootstrapError) -> Self
fn from(err: DatabaseBootstrapError) -> Self
Source§impl From<Error> for TypedExhaustiveQueryError
impl From<Error> for TypedExhaustiveQueryError
Source§impl From<Error> for TypedOperationError
impl From<Error> for TypedOperationError
Source§impl From<Error> for ExhaustiveReadError
impl From<Error> for ExhaustiveReadError
Source§impl From<InternalError> for Error
impl From<InternalError> for Error
Source§fn from(err: InternalError) -> Self
fn from(err: InternalError) -> Self
Source§impl From<QueryError> for Error
impl From<QueryError> for Error
Source§fn from(err: QueryError) -> Self
fn from(err: QueryError) -> Self
impl StructuralPartialEq for Error
Source§impl Wire for Errorwhere
Self: Serialize,
Available on non-target_family=wasm only.
impl Wire for Errorwhere
Self: Serialize,
target_family=wasm only.Source§fn native_schema(
__ic_wire_schema: &mut SchemaContext,
) -> Result<Value, GenerationError>
fn native_schema( __ic_wire_schema: &mut SchemaContext, ) -> Result<Value, GenerationError>
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.