pub struct PollingConfig {
pub max_attempts: u32,
pub poll_interval_secs: u64,
}Expand description
Configuration for attestation polling behavior.
Controls how the bridge polls Circle’s Iris API for attestation availability. Use the builder methods to customize, or use preset configurations for common scenarios.
§Examples
use cctp_rs::PollingConfig;
// Use defaults (30 attempts, 60 second intervals)
let config = PollingConfig::default();
// Customize polling behavior
let config = PollingConfig::default()
.with_max_attempts(20)
.with_poll_interval_secs(30);
// Use preset for fast transfers (30 attempts, 5 second intervals)
let config = PollingConfig::fast_transfer();Fields§
§max_attempts: u32Maximum number of polling attempts before giving up.
poll_interval_secs: u64Seconds to wait between polling attempts.
Implementations§
Source§impl PollingConfig
impl PollingConfig
Sourcepub fn fast_transfer() -> Self
pub fn fast_transfer() -> Self
Creates a polling configuration optimized for CCTP v2 fast transfers.
max_attempts: 30poll_interval_secs: 5
Fast transfers typically complete in under 30 seconds, so this configuration polls more frequently with shorter intervals.
Sourcepub fn with_max_attempts(self, attempts: u32) -> Self
pub fn with_max_attempts(self, attempts: u32) -> Self
Sourcepub fn with_poll_interval_secs(self, secs: u64) -> Self
pub fn with_poll_interval_secs(self, secs: u64) -> Self
Sourcepub fn total_timeout_secs(&self) -> u64
pub fn total_timeout_secs(&self) -> u64
Returns the total maximum wait time in seconds.
This is calculated as max_attempts * poll_interval_secs.
§Example
use cctp_rs::PollingConfig;
let config = PollingConfig::default();
assert_eq!(config.total_timeout_secs(), 30 * 60); // 30 minutesTrait Implementations§
Source§impl Clone for PollingConfig
impl Clone for PollingConfig
Source§fn clone(&self) -> PollingConfig
fn clone(&self) -> PollingConfig
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 PollingConfig
impl Debug for PollingConfig
Source§impl Default for PollingConfig
impl Default for PollingConfig
Source§impl PartialEq for PollingConfig
impl PartialEq for PollingConfig
impl Copy for PollingConfig
impl Eq for PollingConfig
impl StructuralPartialEq for PollingConfig
Auto Trait Implementations§
impl Freeze for PollingConfig
impl RefUnwindSafe for PollingConfig
impl Send for PollingConfig
impl Sync for PollingConfig
impl Unpin for PollingConfig
impl UnwindSafe for PollingConfig
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
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
Compare self to
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>
Converts
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>
Converts
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