Skip to main content

ScopedQueryAs

Trait ScopedQueryAs 

Source
pub trait ScopedQueryAs<'q, DB: SqlxDatabase, O>: Sized + Send {
    // Required methods
    fn fetch_one_scoped(
        self,
    ) -> Pin<Box<dyn Future<Output = Result<O, DbError>> + Send + 'q>>;
    fn fetch_optional_scoped(
        self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<O>, DbError>> + Send + 'q>>;
    fn fetch_all_scoped(
        self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<O>, DbError>> + Send + 'q>>;
    fn fetch_scoped(self) -> ScopedStream<'q, O>;
    fn fetch_many_scoped(
        self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Either<DB::QueryResult, O>>, DbError>> + Send + 'q>>;
}

Required Methods§

Source

fn fetch_one_scoped( self, ) -> Pin<Box<dyn Future<Output = Result<O, DbError>> + Send + 'q>>

Source

fn fetch_optional_scoped( self, ) -> Pin<Box<dyn Future<Output = Result<Option<O>, DbError>> + Send + 'q>>

Source

fn fetch_all_scoped( self, ) -> Pin<Box<dyn Future<Output = Result<Vec<O>, DbError>> + Send + 'q>>

Source

fn fetch_scoped(self) -> ScopedStream<'q, O>

Source

fn fetch_many_scoped( self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Either<DB::QueryResult, O>>, DbError>> + Send + 'q>>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'q, DB, O, A> ScopedQueryAs<'q, DB, O> for QueryAs<'q, DB, O, A>
where DB: SqlxDatabase + 'static, A: IntoArguments<'q, DB> + Send + 'q, O: Send + Unpin + for<'r> FromRow<'r, DB::Row> + 'q, for<'c> &'c mut DB::Connection: Executor<'c, Database = DB>,

Source§

fn fetch_one_scoped( self, ) -> Pin<Box<dyn Future<Output = Result<O, DbError>> + Send + 'q>>

Source§

fn fetch_optional_scoped( self, ) -> Pin<Box<dyn Future<Output = Result<Option<O>, DbError>> + Send + 'q>>

Source§

fn fetch_all_scoped( self, ) -> Pin<Box<dyn Future<Output = Result<Vec<O>, DbError>> + Send + 'q>>

Source§

fn fetch_scoped(self) -> ScopedStream<'q, O>

Source§

fn fetch_many_scoped( self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Either<DB::QueryResult, O>>, DbError>> + Send + 'q>>

Implementors§