pub enum FirestoreWritePrecondition {
Exists(bool),
UpdateTime(DateTime<Utc>),
}Expand description
Re-exports all public items from the db module.
The db module contains the core FirestoreDb client and
functionalities for interacting with the Firestore database, such as CRUD operations,
queries, and transactions.
A precondition on a document, used for conditional write operations in Firestore.
Preconditions allow you to specify conditions that must be met for a write
operation (create, update, delete) to succeed. If the precondition is not met,
the operation will fail, typically with a DataConflictError or similar.
Variants§
Exists(bool)
The target document must exist (if true) or must not exist (if false).
Exists(true): The operation will only succeed if the document already exists. Useful for conditional updates or deletes.Exists(false): The operation will only succeed if the document does not already exist. Useful for conditional creates (to prevent overwriting).
UpdateTime(DateTime<Utc>)
The target document must exist and its update_time must match the provided timestamp.
This is used for optimistic concurrency control. The operation will only succeed
if the document has not been modified since the specified update_time.
The DateTime<Utc> must be microsecond-aligned, as Firestore timestamps have
microsecond precision.
Trait Implementations§
Source§impl Clone for FirestoreWritePrecondition
impl Clone for FirestoreWritePrecondition
Source§fn clone(&self) -> FirestoreWritePrecondition
fn clone(&self) -> FirestoreWritePrecondition
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 FirestoreWritePrecondition
impl Debug for FirestoreWritePrecondition
Source§impl PartialEq for FirestoreWritePrecondition
impl PartialEq for FirestoreWritePrecondition
Source§fn eq(&self, other: &FirestoreWritePrecondition) -> bool
fn eq(&self, other: &FirestoreWritePrecondition) -> bool
self and other values to be equal, and is used by ==.Source§impl TryInto<Precondition> for FirestoreWritePrecondition
impl TryInto<Precondition> for FirestoreWritePrecondition
Source§type Error = FirestoreError
type Error = FirestoreError
impl Eq for FirestoreWritePrecondition
impl StructuralPartialEq for FirestoreWritePrecondition
Auto Trait Implementations§
impl Freeze for FirestoreWritePrecondition
impl RefUnwindSafe for FirestoreWritePrecondition
impl Send for FirestoreWritePrecondition
impl Sync for FirestoreWritePrecondition
impl Unpin for FirestoreWritePrecondition
impl UnsafeUnpin for FirestoreWritePrecondition
impl UnwindSafe for FirestoreWritePrecondition
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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