Skip to main content

repository

Attribute Macro repository 

Source
#[repository]
Available on crate feature di only.
Expand description

Marks a type as part of the Repository layer (Layer 2)

Repositories handle data access and can depend on Domain entities.

§Example

#[repository]
trait UserRepository: Send + Sync {
    async fn find(&self, id: UserId) -> Option<User>;
}