Trait SqlxSelectModelHub

Source
pub trait SqlxSelectModelHub<Model: SqlxModel>:
    Send
    + Sync
    + Sized {
    // Required methods
    fn from_state(state: Model::State) -> Self;
    fn order_by(self, val: Model::ModelOrderBy) -> Self;
    fn maybe_order_by(self, val: Option<Model::ModelOrderBy>) -> Self;
    fn desc(self, val: bool) -> Self;
    fn limit(self, val: i64) -> Self;
    fn offset(self, val: i64) -> Self;
    fn use_struct(self, value: Model::SelectModel) -> Self;
    fn all<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Model>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn count<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<i64>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn one<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Model>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn optional<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Model>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn from_state(state: Model::State) -> Self

Source

fn order_by(self, val: Model::ModelOrderBy) -> Self

Source

fn maybe_order_by(self, val: Option<Model::ModelOrderBy>) -> Self

Source

fn desc(self, val: bool) -> Self

Source

fn limit(self, val: i64) -> Self

Source

fn offset(self, val: i64) -> Self

Source

fn use_struct(self, value: Model::SelectModel) -> Self

Source

fn all<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Model>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn count<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<i64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn one<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Model>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn optional<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<Model>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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§