pub struct FirestoreErrorInTransaction {
pub transaction_id: FirestoreTransactionId,
pub source: Box<dyn Error + Send + Sync>,
}
Expand description
Represents an error that occurred within the scope of a Firestore transaction.
This struct captures errors that happen during the execution of user-provided code within a transaction block, or errors from Firestore related to the transaction itself.
Fields§
§transaction_id: FirestoreTransactionId
The ID of the transaction in which the error occurred.
source: Box<dyn Error + Send + Sync>
The underlying error that caused the transaction to fail.
Implementations§
Source§impl FirestoreErrorInTransaction
impl FirestoreErrorInTransaction
pub fn new( transaction_id: FirestoreTransactionId, source: Box<dyn Error + Send + Sync>, ) -> Self
pub fn transaction_id(&mut self, value: FirestoreTransactionId) -> &mut Self
pub fn with_transaction_id(self, value: FirestoreTransactionId) -> Self
pub fn source(&mut self, value: Box<dyn Error + Send + Sync>) -> &mut Self
pub fn with_source(self, value: Box<dyn Error + Send + Sync>) -> Self
Source§impl FirestoreErrorInTransaction
impl FirestoreErrorInTransaction
Sourcepub fn permanent<E: Error + Send + Sync + 'static>(
transaction: &FirestoreTransaction<'_>,
source: E,
) -> BackoffError<FirestoreError>
pub fn permanent<E: Error + Send + Sync + 'static>( transaction: &FirestoreTransaction<'_>, source: E, ) -> BackoffError<FirestoreError>
Wraps an error as a permanent BackoffError
within a transaction context.
Permanent errors are those that are unlikely to be resolved by retrying the transaction (e.g., data validation errors in user code).
Sourcepub fn transient<E: Error + Send + Sync + 'static>(
transaction: &FirestoreTransaction<'_>,
source: E,
) -> BackoffError<FirestoreError>
pub fn transient<E: Error + Send + Sync + 'static>( transaction: &FirestoreTransaction<'_>, source: E, ) -> BackoffError<FirestoreError>
Wraps an error as a transient BackoffError
within a transaction context.
Transient errors are those that might be resolved by retrying the transaction (e.g., temporary network issues, concurrent modification conflicts).
Sourcepub fn retry_after<E: Error + Send + Sync + 'static>(
transaction: &FirestoreTransaction<'_>,
source: E,
retry_after: Duration,
) -> BackoffError<FirestoreError>
pub fn retry_after<E: Error + Send + Sync + 'static>( transaction: &FirestoreTransaction<'_>, source: E, retry_after: Duration, ) -> BackoffError<FirestoreError>
Wraps an error as a BackoffError
that should be retried after a specific duration.
Trait Implementations§
Source§impl Debug for FirestoreErrorInTransaction
impl Debug for FirestoreErrorInTransaction
Source§impl Error for FirestoreErrorInTransaction
impl Error for FirestoreErrorInTransaction
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<FirestoreErrorInTransactionInit> for FirestoreErrorInTransaction
impl From<FirestoreErrorInTransactionInit> for FirestoreErrorInTransaction
Source§fn from(value: FirestoreErrorInTransactionInit) -> Self
fn from(value: FirestoreErrorInTransactionInit) -> Self
Auto Trait Implementations§
impl Freeze for FirestoreErrorInTransaction
impl !RefUnwindSafe for FirestoreErrorInTransaction
impl Send for FirestoreErrorInTransaction
impl Sync for FirestoreErrorInTransaction
impl Unpin for FirestoreErrorInTransaction
impl !UnwindSafe for FirestoreErrorInTransaction
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
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
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.