[−][src]Struct scylla::transport::session::Session
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]
addr: impl ToSocketAddrs + Display,
compression: Option<Compression>
) -> Result<Self>
Estabilishes a CQL session with the database
Arguments
addr
- address of the servercompression
- optional compression settings
pub async fn query<'_, '_>(
&'_ self,
query: impl Into<Query>,
values: &'_ [Value]
) -> Result<Option<Vec<Row>>>
[src]
&'_ self,
query: impl Into<Query>,
values: &'_ [Value]
) -> Result<Option<Vec<Row>>>
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 performedvalues
- values bound to the query
pub fn query_iter(
&self,
query: impl Into<Query>,
values: &[Value]
) -> Result<RowIterator>
[src]
&self,
query: impl Into<Query>,
values: &[Value]
) -> Result<RowIterator>
pub async fn prepare<'_, '_>(
&'_ self,
query: &'_ str
) -> Result<PreparedStatement>
[src]
&'_ self,
query: &'_ str
) -> Result<PreparedStatement>
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]
&'_ self,
prepared: &'_ PreparedStatement,
values: &'_ [Value]
) -> Result<Option<Vec<Row>>>
Executes a previously prepared statement
Arguments
prepared
- a statement prepared with preparevalues
- values bound to the query
pub fn execute_iter(
&self,
prepared: impl Into<PreparedStatement>,
values: &[Value]
) -> Result<RowIterator>
[src]
&self,
prepared: impl Into<PreparedStatement>,
values: &[Value]
) -> Result<RowIterator>
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,