Struct scylla::statement::prepared_statement::PreparedStatement
source · [−]Expand description
Represents a statement prepared on the server.
Fields
prepare_tracing_ids: Vec<Uuid>
Implementations
sourceimpl PreparedStatement
impl PreparedStatement
pub fn get_id(&self) -> &Bytes
pub fn get_statement(&self) -> &str
sourcepub fn set_page_size(&mut self, page_size: i32)
pub fn set_page_size(&mut self, page_size: i32)
Sets the page size for this CQL query.
sourcepub fn disable_paging(&mut self)
pub fn disable_paging(&mut self)
Disables paging for this CQL query.
sourcepub fn get_page_size(&self) -> Option<i32>
pub fn get_page_size(&self) -> Option<i32>
Returns the page size for this CQL query.
sourcepub fn get_prepare_tracing_ids(&self) -> &[Uuid]
pub fn get_prepare_tracing_ids(&self) -> &[Uuid]
Gets tracing ids of queries used to prepare this statement
sourcepub fn compute_partition_key(
&self,
bound_values: &SerializedValues
) -> Result<Bytes, PartitionKeyError>
pub fn compute_partition_key(
&self,
bound_values: &SerializedValues
) -> Result<Bytes, PartitionKeyError>
Computes the partition key of the target table from given values — it assumes that all partition key columns are passed in values. Partition keys have a specific serialization rules. Ref: https://github.com/scylladb/scylla/blob/40adf38915b6d8f5314c621a94d694d172360833/compound_compat.hh#L33-L47
sourcepub fn get_keyspace_name(&self) -> Option<&str>
pub fn get_keyspace_name(&self) -> Option<&str>
Returns the name of the keyspace this statement is operating on.
sourcepub fn get_table_name(&self) -> Option<&str>
pub fn get_table_name(&self) -> Option<&str>
Returns the name of the table this statement is operating on.
sourcepub fn set_consistency(&mut self, c: Consistency)
pub fn set_consistency(&mut self, c: Consistency)
Sets the consistency to be used when executing this statement.
sourcepub fn get_consistency(&self) -> Option<Consistency>
pub fn get_consistency(&self) -> Option<Consistency>
Gets the consistency to be used when executing this prepared statement if it is filled. If this is empty, the default_consistency of the session will be used.
sourcepub fn set_serial_consistency(&mut self, sc: Option<SerialConsistency>)
pub fn set_serial_consistency(&mut self, sc: Option<SerialConsistency>)
Sets the serial consistency to be used when executing this statement. (Ignored unless the statement is an LWT)
sourcepub fn get_serial_consistency(&self) -> Option<SerialConsistency>
pub fn get_serial_consistency(&self) -> Option<SerialConsistency>
Gets the serial consistency to be used when executing this statement. (Ignored unless the statement is an LWT)
sourcepub fn set_is_idempotent(&mut self, is_idempotent: bool)
pub fn set_is_idempotent(&mut self, is_idempotent: bool)
Sets the idempotence of this statement
A query is idempotent if it can be applied multiple times without changing the result of the initial application
If set to true
we can be sure that it is idempotent
If set to false
it is unknown whether it is idempotent
This is used in RetryPolicy
to decide if retrying a query is safe
sourcepub fn get_is_idempotent(&self) -> bool
pub fn get_is_idempotent(&self) -> bool
Gets the idempotence of this statement
sourcepub fn set_retry_policy(&mut self, retry_policy: Box<dyn RetryPolicy>)
pub fn set_retry_policy(&mut self, retry_policy: Box<dyn RetryPolicy>)
Sets a custom RetryPolicy
to be used with this statement
By default Session’s retry policy is used, this allows to use a custom retry policy
sourcepub fn get_retry_policy(&self) -> &Option<Box<dyn RetryPolicy>>
pub fn get_retry_policy(&self) -> &Option<Box<dyn RetryPolicy>>
Gets custom RetryPolicy
used by this statement
sourcepub fn set_tracing(&mut self, should_trace: bool)
pub fn set_tracing(&mut self, should_trace: bool)
Enable or disable CQL Tracing for this statement If enabled session.execute() will return a QueryResult containing tracing_id which can be used to query tracing information about the execution of this query
sourcepub fn get_tracing(&self) -> bool
pub fn get_tracing(&self) -> bool
Gets whether tracing is enabled for this statement
sourcepub fn set_timestamp(&mut self, timestamp: Option<i64>)
pub fn set_timestamp(&mut self, timestamp: Option<i64>)
Sets the default timestamp for this statement in microseconds.
If not None, it will replace the server side assigned timestamp as default timestamp
If a statement contains a USING TIMESTAMP
clause, calling this method won’t change
anything
sourcepub fn get_timestamp(&self) -> Option<i64>
pub fn get_timestamp(&self) -> Option<i64>
Gets the default timestamp for this statement in microseconds.
Trait Implementations
sourceimpl Clone for PreparedStatement
impl Clone for PreparedStatement
sourcefn clone(&self) -> PreparedStatement
fn clone(&self) -> PreparedStatement
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl From<PreparedStatement> for BatchStatement
impl From<PreparedStatement> for BatchStatement
sourcefn from(p: PreparedStatement) -> Self
fn from(p: PreparedStatement) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl !RefUnwindSafe for PreparedStatement
impl Send for PreparedStatement
impl Sync for PreparedStatement
impl Unpin for PreparedStatement
impl !UnwindSafe for PreparedStatement
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more