pub struct Write {
pub current_document: Option<Precondition>,
pub delete: Option<String>,
pub transform: Option<DocumentTransform>,
pub update: Option<Document>,
pub update_mask: Option<DocumentMask>,
pub update_transforms: Option<Vec<FieldTransform>>,
}
Expand description
A write on a document.
This type is not used in any activity, and only used as part of another schema.
Fields§
§current_document: Option<Precondition>
An optional precondition on the document. The write will fail if this is set and not met by the target document.
delete: Option<String>
A document name to delete. In the format: projects/{project_id}/databases/{database_id}/documents/{document_path}
.
transform: Option<DocumentTransform>
Applies a transformation to a document.
update: Option<Document>
A document to write.
update_mask: Option<DocumentMask>
The fields to update in this write. This field can be set only when the operation is update
. If the mask is not set for an update
and the document exists, any existing data will be overwritten. If the mask is set and the document on the server has fields not covered by the mask, they are left unchanged. Fields referenced in the mask, but not present in the input document, are deleted from the document on the server. The field paths in this mask must not contain a reserved field name.
update_transforms: Option<Vec<FieldTransform>>
The transforms to perform after update. This field can be set only when the operation is update
. If present, this write is equivalent to performing update
and transform
to the same document atomically and in order.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Write
impl<'de> Deserialize<'de> for Write
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Part for Write
Auto Trait Implementations§
impl Freeze for Write
impl RefUnwindSafe for Write
impl Send for Write
impl Sync for Write
impl Unpin for Write
impl UnwindSafe for Write
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<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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more