pub struct RetryPolicy {
pub max_compilation_retries: usize,
pub max_tool_retries: usize,
pub max_review_rejections: usize,
pub compilation_failures: usize,
pub tool_failures: usize,
pub review_rejections: usize,
pub last_error_type: Option<ErrorType>,
}Expand description
Retry policy configuration per PSP-4 specification
Fields§
§max_compilation_retries: usizeMax retries for compilation errors (default: 3)
max_tool_retries: usizeMax retries for tool failures (default: 5)
max_review_rejections: usizeMax reviewer rejections before escalation (default: 3)
compilation_failures: usizeCurrent consecutive failures by type
tool_failures: usize§review_rejections: usize§last_error_type: Option<ErrorType>Last error type encountered
Implementations§
Source§impl RetryPolicy
impl RetryPolicy
Sourcepub fn record_failure(&mut self, error_type: ErrorType)
pub fn record_failure(&mut self, error_type: ErrorType)
Record a failure of a specific type
Sourcepub fn reset_failures(&mut self, error_type: ErrorType)
pub fn reset_failures(&mut self, error_type: ErrorType)
Reset failures of a specific type (on success)
Sourcepub fn should_escalate(&self, error_type: ErrorType) -> bool
pub fn should_escalate(&self, error_type: ErrorType) -> bool
Check if we should escalate for a specific error type
Sourcepub fn any_exceeded(&self) -> bool
pub fn any_exceeded(&self) -> bool
Check if any error type has exceeded its limit
Sourcepub fn failure_count(&self, error_type: ErrorType) -> usize
pub fn failure_count(&self, error_type: ErrorType) -> usize
Get the current failure count for an error type
Sourcepub fn remaining_attempts(&self, error_type: ErrorType) -> usize
pub fn remaining_attempts(&self, error_type: ErrorType) -> usize
Get remaining attempts for an error type
Trait Implementations§
Source§impl Clone for RetryPolicy
impl Clone for RetryPolicy
Source§fn clone(&self) -> RetryPolicy
fn clone(&self) -> RetryPolicy
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 RetryPolicy
impl Debug for RetryPolicy
Source§impl Default for RetryPolicy
impl Default for RetryPolicy
Source§fn default() -> RetryPolicy
fn default() -> RetryPolicy
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for RetryPolicy
impl<'de> Deserialize<'de> for RetryPolicy
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RetryPolicy, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RetryPolicy, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for RetryPolicy
impl Serialize for RetryPolicy
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for RetryPolicy
impl RefUnwindSafe for RetryPolicy
impl Send for RetryPolicy
impl Sync for RetryPolicy
impl Unpin for RetryPolicy
impl UnwindSafe for RetryPolicy
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