[][src]Struct cassandra_cpp::Session

pub struct Session(pub *mut _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.

Methods

impl Session
[src]

pub fn new() -> Session
[src]

Create a new Cassanda session. It's recommended to use Cluster.connect() instead

pub fn connect(self, cluster: &Cluster) -> CassFuture<()>
[src]

Connects a session.

pub fn connect_keyspace(
    &self,
    cluster: &Cluster,
    keyspace: &str
) -> Result<CassFuture<()>>
[src]

Connects a session and sets the keyspace.

pub fn close(self) -> CassFuture<()>
[src]

Closes the session instance, outputs a close future which can be used to determine when the session has been terminated. This allows in-flight requests to finish.

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

Create a prepared statement.

pub fn execute_batch(&self, batch: Batch) -> CassFuture<CassResult>
[src]

Execute a batch statement.

pub fn execute(&self, statement: &Statement) -> CassFuture<CassResult>
[src]

Execute a statement.

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 Drop for Session
[src]

fn drop(&mut self)
[src]

Frees a session instance. If the session is still connected it will be synchronously closed before being deallocated.

impl Send for Session
[src]

impl Sync for Session
[src]

impl Default for Session
[src]

impl Debug for Session
[src]

Blanket Implementations

impl<T> From for T
[src]

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

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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