[][src]Struct discord_cassandra_cpp::Session

pub struct Session(_);

A session object is used to execute queries and maintains cluster state through the control connection. The control connection is used to auto-discover nodes and monitor cluster changes (topology and schema). Each session also maintains multiple /pools of connections to cluster nodes which are used to query the cluster.

Instances of the session object are thread-safe to execute queries.

Implementations

impl Session[src]

pub async fn prepare(&self, query: impl AsRef<str>) -> Result<PreparedStatement>[src]

Create a prepared statement with the given query.

pub fn statement(&self, query: impl AsRef<str>) -> Statement[src]

Creates a statement with the given query.

pub async fn execute(&self, query: impl AsRef<str>) -> Result<CassResult>[src]

Executes a given query.

pub fn batch(&self, batch_type: BatchType) -> Batch[src]

Creates a new batch that is bound to this session.

pub fn get_schema_meta(&self) -> SchemaMeta[src]

Gets a snapshot of this session's schema metadata. The returned snapshot of the schema metadata is not updated. This function must be called again to retrieve any schema changes since the previous call.

pub fn get_metrics(&self) -> SessionMetrics[src]

Gets a copy of this session's performance/diagnostic metrics.

Trait Implementations

impl Clone for Session[src]

impl Debug for Session[src]

impl Default for Session[src]

impl Eq for Session[src]

impl PartialEq<Session> for Session[src]

impl Send for Session[src]

impl StructuralEq for Session[src]

impl StructuralPartialEq for Session[src]

impl Sync for Session[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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.