pub enum ResolutionReason {
None,
StatusCodeOutOfRange,
LatencyExceeded,
SchemaValidationFailed,
RequiredFieldsMissing,
BodyTooShort,
HashMismatch,
EvidenceUnavailable,
GeneralRejection,
Custom(u16),
}Expand description
Resolution reason for oracle verdicts.
Follows Solana’s ProgramError::Custom(u32) pattern: well-known variants
for cross-oracle interoperability, plus Custom(u16) for domain-specific
codes that each oracle defines independently.
On-chain encoding (u16): 0 = None (default for approvals) 1-255 = Standard well-known reasons (interoperable across all oracles) 256+ = Custom oracle-specific codes (meaning defined by each oracle)
§For Oracle Developers
Use standard variants when your rejection reason maps to a well-known
category. Use Custom(code) for domain-specific reasons:
use sla_escrow_api::resolution::ResolutionReason;
// Standard: any oracle can emit this
let reason = ResolutionReason::LatencyExceeded;
// Custom: only your oracle defines what 1001 means
let reason = ResolutionReason::Custom(1001);Variants§
None
No reason — used for approvals or when no specific reason applies.
StatusCodeOutOfRange
HTTP status code fell outside the SLA-specified range.
LatencyExceeded
Response latency exceeded the SLA threshold.
SchemaValidationFailed
Response body failed JSON Schema validation.
RequiredFieldsMissing
One or more required fields were missing from the response.
BodyTooShort
Response body was shorter than the minimum length.
HashMismatch
Delivery evidence hash did not match the on-chain commitment.
Off-chain evidence could not be fetched or was unavailable.
GeneralRejection
General/unspecified rejection (catch-all for standard rejections).
Custom(u16)
Oracle-specific reason code. Each oracle defines its own code meanings.
Values should be >= CUSTOM_REASON_BASE (256).
Implementations§
Trait Implementations§
Source§impl Clone for ResolutionReason
impl Clone for ResolutionReason
Source§fn clone(&self) -> ResolutionReason
fn clone(&self) -> ResolutionReason
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 ResolutionReason
impl Debug for ResolutionReason
Source§impl Display for ResolutionReason
impl Display for ResolutionReason
Source§impl From<ResolutionReason> for u16
impl From<ResolutionReason> for u16
Source§fn from(reason: ResolutionReason) -> u16
fn from(reason: ResolutionReason) -> u16
Source§impl From<u16> for ResolutionReason
impl From<u16> for ResolutionReason
Source§impl PartialEq for ResolutionReason
impl PartialEq for ResolutionReason
Source§fn eq(&self, other: &ResolutionReason) -> bool
fn eq(&self, other: &ResolutionReason) -> bool
self and other values to be equal, and is used by ==.impl Copy for ResolutionReason
impl Eq for ResolutionReason
impl StructuralPartialEq for ResolutionReason
Auto Trait Implementations§
impl Freeze for ResolutionReason
impl RefUnwindSafe for ResolutionReason
impl Send for ResolutionReason
impl Sync for ResolutionReason
impl Unpin for ResolutionReason
impl UnsafeUnpin for ResolutionReason
impl UnwindSafe for ResolutionReason
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more