pub struct FaultPolicy { /* private fields */ }Expand description
The validated retry, backoff, skip, and rollback policy for one step.
The runnable example lives in the oxide-batch facade documentation,
because the supported import path is oxide_batch.
Implementations§
Source§impl FaultPolicy
impl FaultPolicy
Sourcepub fn new(
classifier: FaultClassifier,
retry_limit: RetryLimit,
retry_state_limit: RetryStateLimit,
skip_limit: SkipLimit,
backoff: BackoffPolicy,
) -> Result<FaultPolicy, FaultPolicyError>
pub fn new( classifier: FaultClassifier, retry_limit: RetryLimit, retry_state_limit: RetryStateLimit, skip_limit: SkipLimit, backoff: BackoffPolicy, ) -> Result<FaultPolicy, FaultPolicyError>
Validates and constructs the step policy.
§Errors
Rejects a retry rule that no retry limit can ever satisfy, so a statically impossible combination cannot reach the runtime.
Sourcepub const fn classifier(&self) -> &FaultClassifier
pub const fn classifier(&self) -> &FaultClassifier
Borrows the classifier.
Sourcepub const fn retry_limit(&self) -> RetryLimit
pub const fn retry_limit(&self) -> RetryLimit
Returns the configured retry limit.
Sourcepub const fn retry_state_limit(&self) -> RetryStateLimit
pub const fn retry_state_limit(&self) -> RetryStateLimit
Returns the unresolved retry-key capacity for one step.
Sourcepub const fn skip_limit(&self) -> SkipLimit
pub const fn skip_limit(&self) -> SkipLimit
Returns the aggregate skip limit.
Sourcepub const fn backoff(&self) -> BackoffPolicy
pub const fn backoff(&self) -> BackoffPolicy
Returns the backoff schedule.
Sourcepub fn requires_commit_safe_skip(&self) -> bool
pub fn requires_commit_safe_skip(&self) -> bool
Returns whether any rule accepts a commit-safe skip.
Sourcepub fn validate_capabilities(
&self,
supports_atomic_skip: bool,
) -> Result<(), FaultPolicyError>
pub fn validate_capabilities( &self, supports_atomic_skip: bool, ) -> Result<(), FaultPolicyError>
Verifies the selected resource can honour the policy before user work.
§Errors
Returns FaultPolicyError::CommitSafeSkipUnsupported when a rule
accepts a commit-safe skip that the transaction capability cannot
commit atomically.
Sourcepub fn decide(
&self,
fault: &FaultDescriptor,
evidence: FaultEvidence,
) -> FaultDecision
pub fn decide( &self, fault: &FaultDescriptor, evidence: FaultEvidence, ) -> FaultDecision
Returns the authoritative decision for one fault.
The decision is a pure function of the policy, the framework-owned descriptor, and framework evidence, so it is reproducible after a restart.
Trait Implementations§
Source§impl Clone for FaultPolicy
impl Clone for FaultPolicy
Source§fn clone(&self) -> FaultPolicy
fn clone(&self) -> FaultPolicy
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 FaultPolicy
impl Debug for FaultPolicy
impl Eq for FaultPolicy
Source§impl PartialEq for FaultPolicy
impl PartialEq for FaultPolicy
impl StructuralPartialEq for FaultPolicy
Auto Trait Implementations§
impl Freeze for FaultPolicy
impl RefUnwindSafe for FaultPolicy
impl Send for FaultPolicy
impl Sync for FaultPolicy
impl Unpin for FaultPolicy
impl UnsafeUnpin for FaultPolicy
impl UnwindSafe for FaultPolicy
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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