pub struct SettlementFailureReason { /* private fields */ }Expand description
Bounded failure reason safe for durable storage and telemetry labels.
Implementations§
Source§impl SettlementFailureReason
impl SettlementFailureReason
Sourcepub fn from_detail(
code: SettlementFailureCode,
detail: impl AsRef<[u8]>,
) -> Self
pub fn from_detail( code: SettlementFailureCode, detail: impl AsRef<[u8]>, ) -> Self
Hash an unbounded failure detail into its durable representation.
Sourcepub const fn from_digest(
code: SettlementFailureCode,
detail_sha256: [u8; 32],
) -> Self
pub const fn from_digest( code: SettlementFailureCode, detail_sha256: [u8; 32], ) -> Self
Restore a reason from a persisted digest.
Sourcepub const fn code(&self) -> SettlementFailureCode
pub const fn code(&self) -> SettlementFailureCode
Return the bounded failure code.
Sourcepub const fn detail_sha256(&self) -> &[u8; 32]
pub const fn detail_sha256(&self) -> &[u8; 32]
Return the SHA-256 digest of the original detail.
Sourcepub const fn effective_class(
&self,
requested: SettlementFailureClass,
) -> SettlementFailureClass
pub const fn effective_class( &self, requested: SettlementFailureClass, ) -> SettlementFailureClass
Enforce the retry disposition permitted by this failure code.
Trait Implementations§
Source§impl Clone for SettlementFailureReason
impl Clone for SettlementFailureReason
Source§fn clone(&self) -> SettlementFailureReason
fn clone(&self) -> SettlementFailureReason
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SettlementFailureReason
impl Debug for SettlementFailureReason
Source§impl<'de> Deserialize<'de> for SettlementFailureReason
impl<'de> Deserialize<'de> for SettlementFailureReason
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for SettlementFailureReason
Source§impl PartialEq for SettlementFailureReason
impl PartialEq for SettlementFailureReason
Source§impl Serialize for SettlementFailureReason
impl Serialize for SettlementFailureReason
impl StructuralPartialEq for SettlementFailureReason
Auto Trait Implementations§
impl Freeze for SettlementFailureReason
impl RefUnwindSafe for SettlementFailureReason
impl Send for SettlementFailureReason
impl Sync for SettlementFailureReason
impl Unpin for SettlementFailureReason
impl UnsafeUnpin for SettlementFailureReason
impl UnwindSafe for SettlementFailureReason
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