Trait QueryCollection

Source
pub trait QueryCollection {
    // Required methods
    fn new<'life0, 'async_trait>(
        session: &'life0 Session,
    ) -> Pin<Box<dyn Future<Output = Result<Self, ScyllaxError>> + Send + 'async_trait>>
       where Self: Sized + 'async_trait,
             'life0: 'async_trait;
    fn register_tasks(self, executor: Arc<Executor<Self>>) -> Self
       where Self: Sized;

    // Provided methods
    fn get_prepared<T: Query>(&self) -> &PreparedStatement
       where Self: GetPreparedStatement<T> { ... }
    fn get_task<T: Query + ReadQuery>(&self) -> &Sender<ShardMessage<T>>
       where Self: GetCoalescingSender<T> { ... }
}
Expand description

A collection of prepared statements.

Required Methods§

Source

fn new<'life0, 'async_trait>( session: &'life0 Session, ) -> Pin<Box<dyn Future<Output = Result<Self, ScyllaxError>> + Send + 'async_trait>>
where Self: Sized + 'async_trait, 'life0: 'async_trait,

Create a new collection of prepared statements.

Source

fn register_tasks(self, executor: Arc<Executor<Self>>) -> Self
where Self: Sized,

Register all tasks with the executor.

Provided Methods§

Source

fn get_prepared<T: Query>(&self) -> &PreparedStatement
where Self: GetPreparedStatement<T>,

Gets a prepared statement from the collection.

Source

fn get_task<T: Query + ReadQuery>(&self) -> &Sender<ShardMessage<T>>
where Self: GetCoalescingSender<T>,

Gets a task from the collection.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§