[][src]Struct cassandra_cpp::Statement

pub struct Statement(_);

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

impl Statement[src]

pub fn new(query: &str, parameter_count: usize) -> Self[src]

Creates a new query statement.

pub fn add_key_index(&mut self, index: usize) -> Result<&mut Self>[src]

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.

pub fn set_keyspace(&mut self, keyspace: String) -> Result<&mut Self>[src]

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.

pub fn set_consistency(&mut self, consistency: Consistency) -> Result<&mut Self>[src]

Sets the statement's consistency level.

Default: CASS_CONSISTENCY_LOCAL_ONE

pub fn set_serial_consistency(
    &mut self,
    serial_consistency: Consistency
) -> Result<&mut Self>
[src]

Sets the statement's serial consistency level.

Default: Not set

pub fn set_paging_size(&mut self, page_size: i32) -> Result<&mut Self>[src]

Sets the statement's page size.

Default: -1 (Disabled)

pub fn set_paging_state(&mut self, result: CassResult) -> Result<&mut Self>[src]

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

pub fn set_paging_state_token(
    &mut self,
    paging_state: &str
) -> Result<&mut Self>
[src]

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.

pub fn set_timestamp(&mut self, timestamp: i64) -> Result<&mut Self>[src]

Sets the statement's timestamp.

pub fn set_statement_request_timeout(
    &mut self,
    timeout: Option<Duration>
) -> &mut Self
[src]

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).

pub fn set_retry_policy(
    &mut self,
    retry_policy: RetryPolicy
) -> Result<&mut Self>
[src]

Sets the statement's retry policy.

pub fn set_custom_payload(
    &mut self,
    payload: CustomPayload
) -> Result<&mut Self>
[src]

Sets the statement's custom payload.

pub fn bind_null(&mut self, index: usize) -> Result<&mut Self>[src]

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

pub fn bind_null_by_name(&mut self, name: &str) -> Result<&mut Self>[src]

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

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

pub fn bind_int8(&mut self, index: usize, value: i8) -> Result<&mut Self>[src]

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

pub fn bind_int8_by_name(&mut self, name: &str, value: i8) -> Result<&mut Self>[src]

Binds a "tinyint" to all the values with the specified name.

pub fn bind_int16(&mut self, index: usize, value: i16) -> Result<&mut Self>[src]

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

pub fn bind_int16_by_name(
    &mut self,
    name: &str,
    value: i16
) -> Result<&mut Self>
[src]

Binds a "smallint" to all the values with the specified name.

pub fn bind_int32(&mut self, index: usize, value: i32) -> Result<&mut Self>[src]

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

pub fn bind_int32_by_name(
    &mut self,
    name: &str,
    value: i32
) -> Result<&mut Self>
[src]

Binds an "int" to all the values with the specified name.

pub fn bind_uint32(&mut self, index: usize, value: u32) -> Result<&mut Self>[src]

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

pub fn bind_uint32_by_name(
    &mut self,
    name: &str,
    value: u32
) -> Result<&mut Self>
[src]

Binds a "date" to all the values with the specified name.

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

pub fn bind_int64(&mut self, index: usize, value: i64) -> Result<&mut Self>[src]

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

pub fn bind_int64_by_name(
    &mut self,
    name: &str,
    value: i64
) -> Result<&mut Self>
[src]

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

pub fn bind_float(&mut self, index: usize, value: f32) -> Result<&mut Self>[src]

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

pub fn bind_float_by_name(
    &mut self,
    name: &str,
    value: f32
) -> Result<&mut Self>
[src]

Binds a "float" to all the values with the specified name.

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

pub fn bind_double(&mut self, index: usize, value: f64) -> Result<&mut Self>[src]

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

pub fn bind_double_by_name(
    &mut self,
    name: &str,
    value: f64
) -> Result<&mut Self>
[src]

Binds a "double" to all the values with the specified name.

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

pub fn bind_bool(&mut self, index: usize, value: bool) -> Result<&mut Self>[src]

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

pub fn bind_bool_by_name(
    &mut self,
    name: &str,
    value: bool
) -> Result<&mut Self>
[src]

Binds a "boolean" to all the values with the specified name.

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

pub fn bind_string(&mut self, index: usize, value: &str) -> Result<&mut Self>[src]

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

pub fn bind_string_by_name(
    &mut self,
    name: &str,
    value: &str
) -> Result<&mut Self>
[src]

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().

pub fn bind_bytes(&mut self, index: usize, value: Vec<u8>) -> Result<&mut Self>[src]

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

pub fn bind_bytes_by_name(
    &mut self,
    name: &str,
    value: Vec<u8>
) -> Result<&mut Self>
[src]

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().

pub fn bind_uuid(&mut self, index: usize, value: Uuid) -> Result<&mut Self>[src]

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

pub fn bind_uuid_by_name(
    &mut self,
    name: &str,
    value: Uuid
) -> Result<&mut Self>
[src]

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().

pub fn bind_inet(&mut self, index: usize, value: Inet) -> Result<&mut Self>[src]

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

pub fn bind_inet_by_name(
    &mut self,
    name: &str,
    value: Inet
) -> Result<&mut Self>
[src]

Binds an "inet" to all the values with the specified name.

pub fn bind_map(&mut self, index: usize, map: Map) -> Result<&mut Self>[src]

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

pub fn bind_map_by_name(&mut self, name: &str, map: Map) -> Result<&mut Self>[src]

Bind a "map" to all the values with the specified name.

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

pub fn bind_set(&mut self, index: usize, collection: Set) -> Result<&mut Self>[src]

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

pub fn bind_set_by_name(
    &mut self,
    name: &str,
    collection: Set
) -> Result<&mut Self>
[src]

Bind a "set" to all the values with the specified name.

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

pub fn bind_list(&mut self, index: usize, collection: List) -> Result<&mut Self>[src]

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

pub fn bind_list_by_name(
    &mut self,
    name: &str,
    collection: List
) -> Result<&mut Self>
[src]

Bind a "list" to all the values with the specified name.

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

pub fn bind_tuple(&mut self, index: usize, value: Tuple) -> Result<&mut Self>[src]

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

pub fn bind_tuple_by_name(
    &mut self,
    name: &str,
    value: Tuple
) -> Result<&mut Self>
[src]

Bind a "tuple" to all the values with the specified name.

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

pub fn bind_user_type(
    &mut self,
    index: usize,
    value: &UserType
) -> Result<&mut Self>
[src]

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

pub fn bind_user_type_by_name(
    &mut self,
    name: &str,
    value: &UserType
) -> Result<&mut Self>
[src]

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

Trait Implementations

impl<'_> BindRustType<&'_ UserType> for Statement[src]

impl<'a> BindRustType<&'a str> for Statement[src]

impl BindRustType<Inet> for Statement[src]

impl BindRustType<List> for Statement[src]

impl BindRustType<Map> for Statement[src]

impl BindRustType<Set> for Statement[src]

impl BindRustType<Tuple> for Statement[src]

impl BindRustType<Uuid> for Statement[src]

impl BindRustType<Uuid> for Statement[src]

impl BindRustType<Vec<u8>> for Statement[src]

impl BindRustType<bool> for Statement[src]

impl BindRustType<f32> for Statement[src]

impl BindRustType<f64> for Statement[src]

impl BindRustType<i16> for Statement[src]

impl BindRustType<i32> for Statement[src]

impl BindRustType<i64> for Statement[src]

impl BindRustType<i8> for Statement[src]

impl BindRustType<u32> for Statement[src]

impl Debug for Statement[src]

impl Drop for Statement[src]

fn drop(&mut self)[src]

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

impl Send for Statement[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.