1 个不稳定版本

0.1.0 2023年6月28日

#1231过程宏

自定义许可证

5KB

Cake Pattern自动生成模板

用法

#[orbital::export_service] // <- Add
#[async_trait::async_trait]
pub trait UserRepository: 'static + Sync + Send {
    async fn create(create: CreateUserDto) -> Result<(), ErrorKind>;
    async fn update(update: UpdateUserDto) -> Result<(), ErrorKind>;
    async fn delete(delete: &UserId) -> Result<(), ErrorKind>;

    async fn find_by_id(id: &UserId) -> Result<Option<User>, ErrorKind>;
}

// Auto-Generated by `orbital::export_service`
pub trait DependOnUserRepository: 'static + Sync + Send {
    type UserRepository: UserRepository;
    fn user_repository(&self) -> &Self::UserRepository;
}

依赖项

~270–720KB
~17K SLoC