[][src]Struct scylla::transport::session::Session

pub struct Session { /* fields omitted */ }

Implementations

impl Session[src]

Represents a CQL session, which can be used to communicate with the database

pub async fn connect(
    addr: impl ToSocketAddrs + Display,
    compression: Option<Compression>
) -> Result<Self>
[src]

Estabilishes a CQL session with the database

Arguments

  • addr - address of the server
  • compression - optional compression settings

pub async fn query<'_, '_>(
    &'_ self,
    query: impl Into<Query>,
    values: &'_ [Value]
) -> Result<Option<Vec<Row>>>
[src]

Sends a query to the database and receives a response. If query has paging enabled, this will return only the first page.

Arguments

  • query - query to be performed
  • values - values bound to the query

pub fn query_iter(
    &self,
    query: impl Into<Query>,
    values: &[Value]
) -> Result<RowIterator>
[src]

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

Prepares a statement on the server side and returns a prepared statement, which can later be used to perform more efficient queries

Arguments

pub async fn execute<'_, '_, '_>(
    &'_ self,
    prepared: &'_ PreparedStatement,
    values: &'_ [Value]
) -> Result<Option<Vec<Row>>>
[src]

Executes a previously prepared statement

Arguments

  • prepared - a statement prepared with prepare
  • values - values bound to the query

pub fn execute_iter(
    &self,
    prepared: impl Into<PreparedStatement>,
    values: &[Value]
) -> Result<RowIterator>
[src]

pub fn get_connections(&self) -> Result<Vec<(Node, Vec<Arc<Connection>>)>>[src]

Returns all connections that the session has currently opened.

pub async fn refresh_topology<'_>(&'_ self) -> Result<()>[src]

Auto Trait Implementations

impl !RefUnwindSafe for Session

impl Send for Session

impl Sync for Session

impl Unpin for Session

impl !UnwindSafe for Session

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

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]