Expand description
Repository port traits for data access.
These traits define the interface between the domain layer and the
persistence layer. Implementations live in adapter crates (e.g.
aro-fletch), keeping the core free of framework dependencies.
All trait methods return BoxFuture so that the traits are object-safe
and can be used with dyn Repository<T> for dynamic dispatch (e.g.
via Dep<dyn Repository<User>>).
§Example
ⓘ
async fn get_user(
repo: &dyn Repository<User>,
id: u64,
) -> Result<User, RepoError> {
repo.find_by_id(id).await
}Traits§
- Paginatable
- Trait for repositories that support paginated queries over all rows.
- Queryable
- Trait for repositories that support filtered and sorted queries.
- Repository
- Core CRUD repository trait for a given entity type.
- Transaction
Manager - Trait for managing transactional boundaries across repository operations.
Type Aliases§
- BoxFuture
- A boxed future that is
Sendand tied to the lifetime of&self.