pub trait SearchableRepository<E>: CrudRepository<E>where
E: PersistentEntity,{
// Required methods
fn search<'life0, 'async_trait>(
&'life0 self,
filters: HashMap<String, String>,
page: u32,
limit: u32,
) -> Pin<Box<dyn Future<Output = Result<(Vec<E>, u64), RepositoryError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_by_field<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
field: &'life1 str,
value: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<E>, RepositoryError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn find_all_by_field<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
field: &'life1 str,
value: &'life2 str,
page: u32,
limit: u32,
) -> Pin<Box<dyn Future<Output = Result<(Vec<E>, u64), RepositoryError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
Extended repository with search/filter capabilities
Required Methods§
Sourcefn search<'life0, 'async_trait>(
&'life0 self,
filters: HashMap<String, String>,
page: u32,
limit: u32,
) -> Pin<Box<dyn Future<Output = Result<(Vec<E>, u64), RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn search<'life0, 'async_trait>(
&'life0 self,
filters: HashMap<String, String>,
page: u32,
limit: u32,
) -> Pin<Box<dyn Future<Output = Result<(Vec<E>, u64), RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Search entities with filters
Sourcefn find_by_field<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
field: &'life1 str,
value: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<E>, RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn find_by_field<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
field: &'life1 str,
value: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<E>, RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Find by a specific field value
Sourcefn find_all_by_field<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
field: &'life1 str,
value: &'life2 str,
page: u32,
limit: u32,
) -> Pin<Box<dyn Future<Output = Result<(Vec<E>, u64), RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn find_all_by_field<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
field: &'life1 str,
value: &'life2 str,
page: u32,
limit: u32,
) -> Pin<Box<dyn Future<Output = Result<(Vec<E>, u64), RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Find all by a specific field value
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".