Struct grid_sdk::error::ResourceTemporarilyUnavailableError[][src]

pub struct ResourceTemporarilyUnavailableError { /* fields omitted */ }
Expand description

An error which is returned when an underlying resource is unavailable.

This error can be handled by retrying, usually in a loop with a small delay.

Implementations

Constructs a new ResourceTemporarilyUnavailableError from a specified source error.

The implementation of std::fmt::Display for this error will simply pass through the display of the source message unmodified.

Examples

use grid_sdk::error::ResourceTemporarilyUnavailableError;

let io_err = std::io::Error::new(std::io::ErrorKind::Other, "io error");
let rtu_error = ResourceTemporarilyUnavailableError::from_source(Box::new(io_err));
assert_eq!(format!("{}", rtu_error), "io error");

Constructs a new ResourceTemporarilyUnavailableError from a specified source error with a retry duration hint.

The hint specified here can be used by the caller as the duration between retry attempts. Callers may ignore this hint and provide their own algorithms, or may use this Duration as provided.

The implementation of std::fmt::Display for this error will simply pass through the display of the source message unmodified.

Examples

use std::time::Duration;

use grid_sdk::error::ResourceTemporarilyUnavailableError;

let io_err = std::io::Error::new(std::io::ErrorKind::Other, "io error");
let rtu_error = ResourceTemporarilyUnavailableError::from_source_with_hint(Box::new(io_err), Duration::new(10, 0));
assert_eq!(format!("{}", rtu_error), "io error");

Returns the duration which the underlying library provides as a suggestion for an appropriate amount of time between retry attempts.

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.