pub struct SpannerRetryPolicy { /* private fields */ }Expand description
The retry policy the Spanner client applies to RPCs that do not configure their own. It decorates/extends google_cloud_gax::retry_policy::Aip194Strict.
Like Aip194Strict, this policy retries UNAVAILABLE errors and transient
failures that occur before the request reaches the service, but only for
idempotent requests. In addition — because Spanner allows transport and
connection errors to be retried on idempotent operations — it also retries
transport/network and I/O errors that Aip194Strict would classify as
permanent (such as a connection dropped after the request was sent), again
only if the request is idempotent.
The policy places no limit on the number of attempts or the elapsed time. Applications that want to bound the client’s default retry behavior can decorate this policy with RetryPolicyExt instead of re-implementing its error classification:
§Example
let statement = Statement::builder("SELECT * FROM Users")
.with_retry_policy(
SpannerRetryPolicy::new()
.with_attempt_limit(5)
.with_time_limit(Duration::from_secs(30)),
)
.build();Implementations§
Trait Implementations§
Source§impl Clone for SpannerRetryPolicy
impl Clone for SpannerRetryPolicy
Source§fn clone(&self) -> SpannerRetryPolicy
fn clone(&self) -> SpannerRetryPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SpannerRetryPolicy
impl Debug for SpannerRetryPolicy
Source§impl Default for SpannerRetryPolicy
impl Default for SpannerRetryPolicy
impl RetryPolicy for SpannerRetryPolicy
Auto Trait Implementations§
impl Freeze for SpannerRetryPolicy
impl RefUnwindSafe for SpannerRetryPolicy
impl Send for SpannerRetryPolicy
impl Sync for SpannerRetryPolicy
impl Unpin for SpannerRetryPolicy
impl UnsafeUnpin for SpannerRetryPolicy
impl UnwindSafe for SpannerRetryPolicy
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request