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§
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,
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.