Enum firestore_grpc::google::firestore::v1::document_transform::field_transform::TransformType
source · pub enum TransformType {
SetToServerValue(i32),
Increment(Value),
Maximum(Value),
Minimum(Value),
AppendMissingElements(ArrayValue),
RemoveAllFromArray(ArrayValue),
}
Expand description
The transformation to apply on the field.
Variants§
SetToServerValue(i32)
Sets the field to the given server value.
Increment(Value)
Adds the given value to the field’s current value.
This must be an integer or a double value. If the field is not an integer or double, or if the field does not yet exist, the transformation will set the field to the given value. If either of the given value or the current field value are doubles, both values will be interpreted as doubles. Double arithmetic and representation of double values follow IEEE 754 semantics. If there is positive/negative integer overflow, the field is resolved to the largest magnitude positive/negative integer.
Maximum(Value)
Sets the field to the maximum of its current value and the given value.
This must be an integer or a double value. If the field is not an integer or double, or if the field does not yet exist, the transformation will set the field to the given value. If a maximum operation is applied where the field and the input value are of mixed types (that is - one is an integer and one is a double) the field takes on the type of the larger operand. If the operands are equivalent (e.g. 3 and 3.0), the field does not change. 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and zero input value is always the stored value. The maximum of any numeric value x and NaN is NaN.
Minimum(Value)
Sets the field to the minimum of its current value and the given value.
This must be an integer or a double value. If the field is not an integer or double, or if the field does not yet exist, the transformation will set the field to the input value. If a minimum operation is applied where the field and the input value are of mixed types (that is - one is an integer and one is a double) the field takes on the type of the smaller operand. If the operands are equivalent (e.g. 3 and 3.0), the field does not change. 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and zero input value is always the stored value. The minimum of any numeric value x and NaN is NaN.
AppendMissingElements(ArrayValue)
Append the given elements in order if they are not already present in the current field value. If the field is not an array, or if the field does not yet exist, it is first set to the empty array.
Equivalent numbers of different types (e.g. 3L and 3.0) are considered equal when checking if a value is missing. NaN is equal to NaN, and Null is equal to Null. If the input contains multiple equivalent values, only the first will be considered.
The corresponding transform_result will be the null value.
RemoveAllFromArray(ArrayValue)
Remove all of the given elements from the array in the field. If the field is not an array, or if the field does not yet exist, it is set to the empty array.
Equivalent numbers of the different types (e.g. 3L and 3.0) are considered equal when deciding whether an element should be removed. NaN is equal to NaN, and Null is equal to Null. This will remove all equivalent values if there are duplicates.
The corresponding transform_result will be the null value.
Implementations§
source§impl TransformType
impl TransformType
Trait Implementations§
source§impl Clone for TransformType
impl Clone for TransformType
source§fn clone(&self) -> TransformType
fn clone(&self) -> TransformType
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TransformType
impl Debug for TransformType
source§impl PartialEq for TransformType
impl PartialEq for TransformType
source§fn eq(&self, other: &TransformType) -> bool
fn eq(&self, other: &TransformType) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for TransformType
Auto Trait Implementations§
impl Freeze for TransformType
impl RefUnwindSafe for TransformType
impl Send for TransformType
impl Sync for TransformType
impl Unpin for TransformType
impl UnwindSafe for TransformType
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