Struct tarantool::space::UpdateOps

source ·
pub struct UpdateOps { /* private fields */ }
Expand description

A builder-style helper struct for Space::update, Space::upsert, Index::update, Index::upsert methods.

Start by calling the new function, then chain as many operations as needed (add, assign, insert, etc.) after that you can either pass the resulting expression directly into one of the supported methods, or use the data directly after calling encode or into_inner.

Examples

use tarantool::space::{Space, UpdateOps};
let mut space = Space::find("employee").unwrap();
space.update(
    &[1337],
    UpdateOps::new()
        .add("strikes", 1).unwrap()
        .assign("days-since-last-mistake", 0).unwrap(),
)
.unwrap();

Implementations§

Assignment operation. Corresponds to tarantool’s {'=', field, value}.

Field indexing is zero based (first field has index 0). Negative indexes are offset from array’s end (last field has index -1).

Insertion operation. Corresponds to tarantool’s {'!', field, value}.

Field indexing is zero based (first field has index 0). Negative indexes are offset from array’s end (last field has index -1).

Numeric addition operation. Corresponds to tarantool’s {'+', field, value}.

Field indexing is zero based (first field has index 0). Negative indexes are offset from array’s end (last field has index -1).

Numeric subtraction operation. Corresponds to tarantool’s {'-', field, value}.

Field indexing is zero based (first field has index 0). Negative indexes are offset from array’s end (last field has index -1).

Bitwise AND operation. Corresponds to tarantool’s {'&', field, value}.

Field indexing is zero based (first field has index 0). Negative indexes are offset from array’s end (last field has index -1).

Bitwise OR operation. Corresponds to tarantool’s {'|', field, value}.

Field indexing is zero based (first field has index 0). Negative indexes are offset from array’s end (last field has index -1).

Bitwise XOR operation. Corresponds to tarantool’s {'^', field, value}.

Field indexing is zero based (first field has index 0). Negative indexes are offset from array’s end (last field has index -1).

Deletion operation. Corresponds to tarantool’s {'#', field, count}.

Field indexing is zero based (first field has index 0). Negative indexes are offset from array’s end (last field has index -1).

String splicing operation. Corresponds to tarantool’s {':', field, start, count, value}.

Field indexing is zero based (first field has index 0). Negative indexes are offset from array’s end (last field has index -1).

Trait Implementations§

Converts this type into a shared reference of the (usually inferred) input type.
Returns the “default value” for a type. Read more
Converts to this type from the input type.
The type of the elements being iterated over.
Which kind of iterator are we turning this into?
Creates an iterator from a value. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.