pub struct TransactionRetrySetting {
pub inner: RetrySetting,
}Fields§
§inner: RetrySettingImplementations§
source§impl TransactionRetrySetting
impl TransactionRetrySetting
sourcepub fn new(codes: Vec<Code>) -> Self
pub fn new(codes: Vec<Code>) -> Self
Examples found in repository?
More examples
src/client.rs (line 338)
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364
pub async fn partitioned_update_with_option(
&self,
stmt: Statement,
options: PartitionedUpdateOption,
) -> Result<i64, TxError> {
let ro = TransactionRetrySetting::new(vec![Code::Aborted, Code::Internal]);
let session = Some(self.get_session().await?);
// reuse session
invoke_fn(
options.begin_options.cancel.clone(),
Some(ro),
|session| async {
let mut tx =
match ReadWriteTransaction::begin_partitioned_dml(session.unwrap(), options.begin_options.clone())
.await
{
Ok(tx) => tx,
Err(e) => return Err((TxError::GRPC(e.status), Some(e.session))),
};
let qo = match options.query_options.clone() {
Some(o) => o,
None => QueryOptions::default(),
};
tx.update_with_option(stmt.clone(), qo)
.await
.map_err(|e| (TxError::GRPC(e), tx.take_session()))
},
session,
)
.await
}Trait Implementations§
source§impl Clone for TransactionRetrySetting
impl Clone for TransactionRetrySetting
source§fn clone(&self) -> TransactionRetrySetting
fn clone(&self) -> TransactionRetrySetting
Returns a copy 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 TransactionRetrySetting
impl Debug for TransactionRetrySetting
source§impl Default for TransactionRetrySetting
impl Default for TransactionRetrySetting
source§impl<E> Retry<E, TransactionCondition<E>> for TransactionRetrySettingwhere
E: TryAs<Status>,
impl<E> Retry<E, TransactionCondition<E>> for TransactionRetrySettingwhere
E: TryAs<Status>,
Auto Trait Implementations§
impl RefUnwindSafe for TransactionRetrySetting
impl Send for TransactionRetrySetting
impl Sync for TransactionRetrySetting
impl Unpin for TransactionRetrySetting
impl UnwindSafe for TransactionRetrySetting
Blanket Implementations§
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>
Wrap the input message
T in a tonic::Request