Struct cassandra_cpp::Session[][src]

pub struct Session(pub *mut _Session);
Expand description

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 fn new() -> Session[src]

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

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

Notable traits for CassFuture<T>

impl<T: Completable> Future for CassFuture<T> type Output = Result<T>;
[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<()>

Notable traits for CassFuture<T>

impl<T: Completable> Future for CassFuture<T> type Output = Result<T>;
[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>

Notable traits for CassFuture<T>

impl<T: Completable> Future for CassFuture<T> type Output = Result<T>;
[src]

Execute a batch statement.

pub fn execute_batch_with_payloads(
    &self,
    batch: &Batch
) -> CassFuture<(CassResult, HashMap<String, Vec<u8>>)>

Notable traits for CassFuture<T>

impl<T: Completable> Future for CassFuture<T> type Output = Result<T>;
[src]

Execute a batch statement and get any custom payloads from the response.

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

Notable traits for CassFuture<T>

impl<T: Completable> Future for CassFuture<T> type Output = Result<T>;
[src]

Execute a statement.

pub fn execute_with_payloads(
    &self,
    statement: &Statement
) -> CassFuture<(CassResult, HashMap<String, Vec<u8>>)>

Notable traits for CassFuture<T>

impl<T: Completable> Future for CassFuture<T> type Output = Result<T>;
[src]

Execute a statement and get any custom payloads from the response.

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

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Default for Session[src]

fn default() -> Session[src]

Returns the “default value” for a type. Read more

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]

Auto Trait Implementations

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

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