Struct discord_cassandra_cpp::Session
source · [−]pub struct Session<T = Bound>(_);
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
sourceimpl<S> Session<S> where
S: SessionScope,
impl<S> Session<S> where
S: SessionScope,
sourcepub fn statement(&self, query: impl AsRef<str>) -> Statement<S>
pub fn statement(&self, query: impl AsRef<str>) -> Statement<S>
Creates a statement with the given query.
sourcepub async fn execute(&self, query: impl AsRef<str>) -> Result<CassResult>
pub async fn execute(&self, query: impl AsRef<str>) -> Result<CassResult>
Executes a given query.
sourcepub fn batch(&self, batch_type: BatchType) -> Batch<S>
pub fn batch(&self, batch_type: BatchType) -> Batch<S>
Creates a new batch that is bound to this session.
sourcepub fn get_schema_meta(&self) -> SchemaMeta
pub fn get_schema_meta(&self) -> SchemaMeta
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.
sourcepub fn get_metrics(&self) -> SessionMetrics
pub fn get_metrics(&self) -> SessionMetrics
Gets a copy of this session’s performance/diagnostic metrics.
Trait Implementations
impl<T> Eq for Session<T>
impl<T: Send> Send for Session<T>
impl<T: Sync> Sync for Session<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Session<T> where
T: RefUnwindSafe,
impl<T> Unpin for Session<T>
impl<T> UnwindSafe for Session<T> where
T: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more