pub struct Statement(_);
Expand description

A statement object is an executable query. It represents either a regular (adhoc) statement or a prepared statement. It maintains the queries’ parameter values along with query options (consistency level, paging state, etc.)

Note: Parameters for regular queries are not supported by the binary protocol version 1.

Implementations§

Creates a new query statement.

Adds a key index specifier to this a statement. When using token-aware routing, this can be used to tell the driver which parameters within a non-prepared, parameterized statement are part of the partition key.

Use consecutive calls for composite partition keys.

This is not necessary for prepared statements, as the key parameters are determined in the metadata processed in the prepare phase.

Sets the statement’s keyspace for use with token-aware routing.

This is not necessary for prepared statements, as the keyspace is determined in the metadata processed in the prepare phase.

Sets the statement’s consistency level.

Default: CASS_CONSISTENCY_LOCAL_ONE

Sets the statement’s serial consistency level.

Default: Not set

Sets the statement’s page size.

Default: -1 (Disabled)

Sets the statement’s paging state. This can be used to get the next page of data in a multi-page query.

Sets the statement’s paging state. This can be used to get the next page of data in a multi-page query.

Warning: The paging state should not be exposed to or come from untrusted environments. The paging state could be spoofed and potentially used to gain access to other data.

Sets the statement’s timestamp.

Sets the statement’s timeout for waiting for a response from a node. Some(Duration::milliseconds(0)) sets no timeout, and None disables it (to use the cluster-level request timeout).

Sets the statement’s retry policy.

Sets the statement’s custom payload.

Binds null to a query or bound statement at the specified index.

Binds a null to all the values with the specified name.

This can only be used with statements created by cass_prepared_bind().

Binds a “tinyint” to a query or bound statement at the specified index.

Binds a “tinyint” to all the values with the specified name.

Binds an “smallint” to a query or bound statement at the specified index.

Binds a “smallint” to all the values with the specified name.

Binds an “int” to a query or bound statement at the specified index.

Binds an “int” to all the values with the specified name.

Binds a “date” to a query or bound statement at the specified index.

Binds a “date” to all the values with the specified name.

This can only be used with statements created by cass_prepared_bind().

Binds a “bigint”, “counter”, “timestamp” or “time” to a query or bound statement at the specified index.

Binds a “bigint”, “counter”, “timestamp” or “time” to all values with the specified name.

Binds a “float” to a query or bound statement at the specified index.

Binds a “float” to all the values with the specified name.

This can only be used with statements created by cass_prepared_bind().

Binds a “double” to a query or bound statement at the specified index.

Binds a “double” to all the values with the specified name.

This can only be used with statements created by cass_prepared_bind().

Binds a “boolean” to a query or bound statement at the specified index.

Binds a “boolean” to all the values with the specified name.

This can only be used with statements created by cass_prepared_bind().

Binds an “ascii”, “text” or “varchar” to a query or bound statement at the specified index.

Binds an “ascii”, “text” or “varchar” to all the values with the specified name.

This can only be used with statements created by cass_prepared_bind().

Binds a “blob”, “varint” or “custom” to a query or bound statement at the specified index.

Binds a “blob”, “varint” or “custom” to all the values with the specified name.

This can only be used with statements created by cass_prepared_bind().

Binds a “uuid” or “timeuuid” to a query or bound statement at the specified index.

Binds a “uuid” or “timeuuid” to all the values with the specified name.

This can only be used with statements created by cass_prepared_bind().

Binds an “inet” to a query or bound statement at the specified index.

Binds an “inet” to all the values with the specified name.

Bind a “map” to a query or bound statement at the specified index.

Bind a “map” to all the values with the specified name.

This can only be used with statements created by cass_prepared_bind().

Bind a “set” to a query or bound statement at the specified index.

Bind a “set” to all the values with the specified name.

This can only be used with statements created by cass_prepared_bind().

Bind a “list” to a query or bound statement at the specified index.

Bind a “list” to all the values with the specified name.

This can only be used with statements created by cass_prepared_bind().

Bind a “tuple” to a query or bound statement at the specified index.

Bind a “tuple” to all the values with the specified name.

This can only be used with statements created by cass_prepared_bind().

Bind a user defined type to a query or bound statement at the specified index.

Bind a user defined type to a query or bound statement with the specified name.

Trait Implementations§

binds a rust type to C* by index
binds a rust type to C* by name
binds a rust type to C* by index
binds a rust type to C* by name
binds a rust type to C* by index
binds a rust type to C* by name
binds a rust type to C* by index
binds a rust type to C* by name
binds a rust type to C* by index
binds a rust type to C* by name
binds a rust type to C* by index
binds a rust type to C* by name
binds a rust type to C* by index
binds a rust type to C* by name
binds a rust type to C* by index
binds a rust type to C* by name
binds a rust type to C* by index
binds a rust type to C* by name
binds a rust type to C* by index
binds a rust type to C* by name
Formats the value using the given formatter. Read more

Frees a statement instance. Statements can be immediately freed after being prepared, executed or added to a batch.

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.

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.