#[non_exhaustive]pub struct CodeWaitConfig {
pub timeout_ms: u32,
pub poll_interval_ms: u32,
pub max_polls: u32,
}Expand description
Portable millisecond limits for code-appearance waiting, without a misleading confirmation-depth setting. At most 100,000 completed observations.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.timeout_ms: u32Overall deadline, 1..=i32::MAX milliseconds, including RPCs and delays.
poll_interval_ms: u32Positive interval, no longer than the timeout.
max_polls: u32Independent limit of 1..100000 completed observations.
Implementations§
Source§impl CodeWaitConfig
impl CodeWaitConfig
Sourcepub const fn new(timeout_ms: u32, poll_interval_ms: u32, max_polls: u32) -> Self
pub const fn new(timeout_ms: u32, poll_interval_ms: u32, max_polls: u32) -> Self
Every limit is required: there is deliberately no default.
Sourcepub const fn with_timeout_ms(self, timeout_ms: u32) -> Self
pub const fn with_timeout_ms(self, timeout_ms: u32) -> Self
Replace timeout_ms.
Sourcepub const fn with_poll_interval_ms(self, poll_interval_ms: u32) -> Self
pub const fn with_poll_interval_ms(self, poll_interval_ms: u32) -> Self
Replace poll_interval_ms.
Sourcepub const fn with_max_polls(self, max_polls: u32) -> Self
pub const fn with_max_polls(self, max_polls: u32) -> Self
Replace max_polls.
Sourcepub fn validate(self) -> Result<(), CodeWaitError>
pub fn validate(self) -> Result<(), CodeWaitError>
Validate before timers or I/O on both native and browser runtimes.
Trait Implementations§
Source§impl Clone for CodeWaitConfig
impl Clone for CodeWaitConfig
impl Copy for CodeWaitConfig
Auto Trait Implementations§
impl Forget for CodeWaitConfig
impl Freeze for CodeWaitConfig
impl Move for CodeWaitConfig
impl RefUnwindSafe for CodeWaitConfig
impl Send for CodeWaitConfig
impl Sync for CodeWaitConfig
impl Unpin for CodeWaitConfig
impl UnsafeUnpin for CodeWaitConfig
impl UnwindSafe for CodeWaitConfig
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