Struct bigml::wait::WaitOptions
source · pub struct WaitOptions { /* private fields */ }
Expand description
Options controlling how long we wait and what makes us give up. This uses a “builder” pattern, so you can write:
use std::time::Duration;
use bigml::wait::WaitOptions;
let options = WaitOptions::default()
.timeout(Duration::from_secs(120))
.allowed_errors(5);
Implementations§
source§impl WaitOptions
impl WaitOptions
sourcepub fn timeout<D: Into<Option<Duration>>>(self, timeout: D) -> Self
pub fn timeout<D: Into<Option<Duration>>>(self, timeout: D) -> Self
Set an optional timeout after which to abandon this wait
.
sourcepub fn retry_interval(self, interval: Duration) -> Self
pub fn retry_interval(self, interval: Duration) -> Self
How long should we wait between retries? Defaults to 10 seconds. Note that BigML has suggested not polling more often than every 4 seconds, (to avoid losing API access) so if you set a lower value, this will be
sourcepub fn backoff_type(self, backoff_type: BackoffType) -> Self
pub fn backoff_type(self, backoff_type: BackoffType) -> Self
Should we use linear (default) or exponential backoff?
sourcepub fn allowed_errors(self, count: u16) -> Self
pub fn allowed_errors(self, count: u16) -> Self
How many errors should be ignored before giving up? This can be useful
for long-running Execution
jobs, where we don’t want a transient
network error to result in failure.
Trait Implementations§
source§impl Debug for WaitOptions
impl Debug for WaitOptions
Auto Trait Implementations§
impl RefUnwindSafe for WaitOptions
impl Send for WaitOptions
impl Sync for WaitOptions
impl Unpin for WaitOptions
impl UnwindSafe for WaitOptions
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