mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-29 02:00:31 +08:00
Move AppState to radicle-types
This commit is contained in:
@@ -6,34 +6,10 @@ use tauri::Manager;
|
||||
use radicle::node::Handle;
|
||||
use radicle::Node;
|
||||
use radicle_types::error::Error;
|
||||
use radicle_types::traits::auth::Auth;
|
||||
use radicle_types::traits::cobs::Cobs;
|
||||
use radicle_types::traits::issue::{Issues, IssuesMut};
|
||||
use radicle_types::traits::patch::{Patches, PatchesMut};
|
||||
use radicle_types::traits::repo::Repo;
|
||||
use radicle_types::traits::thread::Thread;
|
||||
use radicle_types::traits::Profile;
|
||||
use radicle_types::AppState;
|
||||
|
||||
use commands::{auth, cob, diff, profile, repo, thread};
|
||||
|
||||
struct AppState {
|
||||
profile: radicle::Profile,
|
||||
}
|
||||
|
||||
impl Auth for AppState {}
|
||||
impl Repo for AppState {}
|
||||
impl Thread for AppState {}
|
||||
impl Cobs for AppState {}
|
||||
impl Issues for AppState {}
|
||||
impl IssuesMut for AppState {}
|
||||
impl Patches for AppState {}
|
||||
impl PatchesMut for AppState {}
|
||||
impl Profile for AppState {
|
||||
fn profile(&self) -> radicle::Profile {
|
||||
self.profile.clone()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
#[cfg(debug_assertions)]
|
||||
|
||||
@@ -1,5 +1,32 @@
|
||||
use traits::auth::Auth;
|
||||
use traits::cobs::Cobs;
|
||||
use traits::issue::{Issues, IssuesMut};
|
||||
use traits::patch::{Patches, PatchesMut};
|
||||
use traits::repo::Repo;
|
||||
use traits::thread::Thread;
|
||||
use traits::Profile;
|
||||
|
||||
pub mod cobs;
|
||||
pub mod config;
|
||||
pub mod error;
|
||||
pub mod repo;
|
||||
pub mod test;
|
||||
pub mod traits;
|
||||
|
||||
pub struct AppState {
|
||||
pub profile: radicle::Profile,
|
||||
}
|
||||
|
||||
impl Auth for AppState {}
|
||||
impl Repo for AppState {}
|
||||
impl Thread for AppState {}
|
||||
impl Cobs for AppState {}
|
||||
impl Issues for AppState {}
|
||||
impl IssuesMut for AppState {}
|
||||
impl Patches for AppState {}
|
||||
impl PatchesMut for AppState {}
|
||||
impl Profile for AppState {
|
||||
fn profile(&self) -> radicle::Profile {
|
||||
self.profile.clone()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user