pub struct RetryHint {
pub should_retry: bool,
pub retry_after_ms: Option<u64>,
pub max_attempts: Option<u32>,
}Expand description
Structured retry guidance attached to every AdkError.
Fields§
§should_retry: bool§retry_after_ms: Option<u64>§max_attempts: Option<u32>Implementations§
Source§impl RetryHint
impl RetryHint
Sourcepub fn for_category(category: ErrorCategory) -> Self
pub fn for_category(category: ErrorCategory) -> Self
Derive a default retry hint from the error category.
Sourcepub fn retry_after(&self) -> Option<Duration>
pub fn retry_after(&self) -> Option<Duration>
Convert retry_after_ms to a Duration.
Sourcepub fn with_retry_after(self, duration: Duration) -> Self
pub fn with_retry_after(self, duration: Duration) -> Self
Set the retry-after delay from a Duration.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RetryHint
impl<'de> Deserialize<'de> for RetryHint
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
Auto Trait Implementations§
impl Freeze for RetryHint
impl RefUnwindSafe for RetryHint
impl Send for RetryHint
impl Sync for RetryHint
impl Unpin for RetryHint
impl UnsafeUnpin for RetryHint
impl UnwindSafe for RetryHint
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