#[repr(u32)]pub enum RejectCode {
SysFatal = 1,
SysTransient = 2,
DestinationInvalid = 3,
CanisterReject = 4,
CanisterError = 5,
SysUnknown = 6,
Unrecognized(u32),
}Expand description
Classifies why an API request or inter-canister call in the IC is rejected.
§Note
Zero (0) is not a valid reject code. Converting 0 into this enum will return an error.
See Reject codes for more details.
Variants§
SysFatal = 1
Fatal system error, retry unlikely to be useful.
SysTransient = 2
Transient system error, retry might be possible.
DestinationInvalid = 3
Invalid destination (e.g. canister/account does not exist).
CanisterReject = 4
Explicit reject by the canister.
CanisterError = 5
Canister error (e.g., trap, no response).
SysUnknown = 6
Response unknown; system stopped waiting for it (e.g., timed out, or system under high load).
Unrecognized(u32)
Unrecognized reject code.
§Note
This variant is not part of the IC interface spec, and is used to represent reject codes that are not recognized by the library.
This variant is needed just in case the IC introduces new reject codes in the future. If that happens, a Canister using existing library versions will still be able to convert the new reject codes to this variant without panicking.
Trait Implementations§
Source§impl Clone for RejectCode
impl Clone for RejectCode
Source§fn clone(&self) -> RejectCode
fn clone(&self) -> RejectCode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RejectCode
impl Debug for RejectCode
Source§impl Display for RejectCode
impl Display for RejectCode
Source§impl From<RejectCode> for u32
impl From<RejectCode> for u32
Source§fn from(code: RejectCode) -> u32
fn from(code: RejectCode) -> u32
Source§impl Hash for RejectCode
impl Hash for RejectCode
Source§impl Ord for RejectCode
impl Ord for RejectCode
Source§fn cmp(&self, other: &RejectCode) -> Ordering
fn cmp(&self, other: &RejectCode) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq<u32> for RejectCode
impl PartialEq<u32> for RejectCode
Source§impl PartialEq for RejectCode
impl PartialEq for RejectCode
Source§fn eq(&self, other: &RejectCode) -> bool
fn eq(&self, other: &RejectCode) -> bool
self and other values to be equal, and is used by ==.