#[non_exhaustive]pub enum CanonicalError {
Show 16 variants
#[non_exhaustive] Cancelled {
ctx: Cancelled,
detail: String,
resource_type: Option<String>,
resource_name: Option<String>,
},
#[non_exhaustive] Unknown {
ctx: Unknown,
detail: String,
resource_type: Option<String>,
resource_name: Option<String>,
},
#[non_exhaustive] InvalidArgument {
ctx: InvalidArgument,
detail: String,
resource_type: Option<String>,
resource_name: Option<String>,
},
#[non_exhaustive] DeadlineExceeded {
ctx: DeadlineExceeded,
detail: String,
resource_type: Option<String>,
resource_name: Option<String>,
},
#[non_exhaustive] NotFound {
ctx: NotFound,
detail: String,
resource_type: Option<String>,
resource_name: Option<String>,
},
#[non_exhaustive] AlreadyExists {
ctx: AlreadyExists,
detail: String,
resource_type: Option<String>,
resource_name: Option<String>,
},
#[non_exhaustive] PermissionDenied {
ctx: PermissionDenied,
detail: String,
resource_type: Option<String>,
resource_name: Option<String>,
},
#[non_exhaustive] ResourceExhausted {
ctx: ResourceExhausted,
detail: String,
resource_type: Option<String>,
resource_name: Option<String>,
},
#[non_exhaustive] FailedPrecondition {
ctx: FailedPrecondition,
detail: String,
resource_type: Option<String>,
resource_name: Option<String>,
},
#[non_exhaustive] Aborted {
ctx: Aborted,
detail: String,
resource_type: Option<String>,
resource_name: Option<String>,
},
#[non_exhaustive] OutOfRange {
ctx: OutOfRange,
detail: String,
resource_type: Option<String>,
resource_name: Option<String>,
},
#[non_exhaustive] Unimplemented {
ctx: Unimplemented,
detail: String,
resource_type: Option<String>,
resource_name: Option<String>,
},
#[non_exhaustive] Internal {
ctx: Internal,
detail: String,
},
#[non_exhaustive] ServiceUnavailable {
ctx: ServiceUnavailable,
detail: String,
resource_type: Option<String>,
resource_name: Option<String>,
},
#[non_exhaustive] DataLoss {
ctx: DataLoss,
detail: String,
resource_type: Option<String>,
resource_name: Option<String>,
},
#[non_exhaustive] Unauthenticated {
ctx: Unauthenticated,
detail: String,
resource_type: Option<String>,
resource_name: Option<String>,
},
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
#[non_exhaustive]Cancelled
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
#[non_exhaustive]Unknown
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
#[non_exhaustive]InvalidArgument
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§
ctx: InvalidArgument#[non_exhaustive]DeadlineExceeded
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§
ctx: DeadlineExceeded#[non_exhaustive]NotFound
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
#[non_exhaustive]AlreadyExists
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§
ctx: AlreadyExists#[non_exhaustive]PermissionDenied
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§
ctx: PermissionDenied#[non_exhaustive]ResourceExhausted
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§
ctx: ResourceExhausted#[non_exhaustive]FailedPrecondition
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§
ctx: FailedPrecondition#[non_exhaustive]Aborted
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
#[non_exhaustive]OutOfRange
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§
ctx: OutOfRange#[non_exhaustive]Unimplemented
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§
ctx: Unimplemented#[non_exhaustive]Internal
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
#[non_exhaustive]DataLoss
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
#[non_exhaustive]Unauthenticated
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§
ctx: UnauthenticatedImplementations§
Source§impl CanonicalError
impl CanonicalError
pub fn internal( detail: impl Into<String>, ) -> ResourceErrorBuilder<ResourceAbsent, NoContext>
pub fn unauthenticated() -> ResourceErrorBuilder<ResourceAbsent, NeedsReason>
Source§impl CanonicalError
impl CanonicalError
pub fn detail(&self) -> &str
pub fn resource_type(&self) -> Option<&str>
pub fn resource_name(&self) -> Option<&str>
Sourcepub fn diagnostic(&self) -> Option<&str>
pub fn diagnostic(&self) -> Option<&str>
Returns the internal diagnostic string for Internal and Unknown
variants, or None for all other categories.
Middleware should call this before converting to Problem so
that the real cause can be logged server-side with the trace_id.
The diagnostic is never included in production wire responses.
pub fn gts_type(&self) -> &'static str
pub fn status_code(&self) -> u16
pub fn title(&self) -> &'static str
Trait Implementations§
Source§impl Clone for CanonicalError
impl Clone for CanonicalError
Source§fn clone(&self) -> CanonicalError
fn clone(&self) -> CanonicalError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CanonicalError
impl Debug for CanonicalError
Source§impl Display for CanonicalError
impl Display for CanonicalError
Source§impl Error for CanonicalError
impl Error for CanonicalError
1.30.0 · 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<CanonicalError> for Problem
impl From<CanonicalError> for Problem
Source§fn from(err: CanonicalError) -> Self
fn from(err: CanonicalError) -> Self
Converts to this type from the input type.
Source§impl From<Error> for CanonicalError
impl From<Error> for CanonicalError
Auto Trait Implementations§
impl Freeze for CanonicalError
impl RefUnwindSafe for CanonicalError
impl Send for CanonicalError
impl Sync for CanonicalError
impl Unpin for CanonicalError
impl UnsafeUnpin for CanonicalError
impl UnwindSafe for CanonicalError
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