pub mod git; pub mod github; use async_trait::async_trait; use std::error::Error; use crate::{ messages::{ repository::{ CreateRepositoryRequest, CreateRepositoryResponse, RepositoryFileInspectRequest, RepositoryFileInspectionResponse, RepositoryInfoRequest, RepositoryIssueLabelsRequest, RepositoryIssueLabelsResponse, RepositoryIssuesCountRequest, RepositoryIssuesCountResponse, RepositoryIssuesRequest, RepositoryIssuesResponse, }, user::{ UserBioRequest, UserBioResponse, UserDisplayImageRequest, UserDisplayImageResponse, UserDisplayNameRequest, UserDisplayNameResponse, }, Authenticated, }, model::repository::RepositoryView, }; #[async_trait] pub trait RepositoryBackend: IssuesBackend { async fn create_repository( &mut self, request: &Authenticated, ) -> Result>; async fn repository_info( &mut self, request: &RepositoryInfoRequest, ) -> Result>; fn repository_file_inspect( &mut self, request: &RepositoryFileInspectRequest, ) -> Result>; } pub trait IssuesBackend { fn issues_count( &mut self, request: &RepositoryIssuesCountRequest, ) -> Result>; fn issue_labels( &mut self, request: &RepositoryIssueLabelsRequest, ) -> Result>; fn issues( &mut self, request: &RepositoryIssuesRequest, ) -> Result>; } pub trait AuthBackend { fn register(&mut self, request: ()) -> Result<(), Box>; fn login(&mut self, request: ()) -> Result<(), Box>; } pub trait UserBackend { fn display_name( &mut self, request: UserDisplayNameRequest, ) -> Result>; fn display_image( &mut self, request: UserDisplayImageRequest, ) -> Result>; fn bio(&mut self, request: UserBioRequest) -> Result>; }