Adds the new Rust-based UI (iced), backend service, shared Swift models, CI/CD workflows, build scripts, and project documentation.
38 lines
744 B
Rust
38 lines
744 B
Rust
use std::io;
|
|
|
|
use thiserror::Error;
|
|
|
|
/// Backend error type
|
|
#[derive(Error, Debug)]
|
|
pub enum BackendError {
|
|
#[error("IO error: {0}")]
|
|
Io(#[from] io::Error),
|
|
|
|
#[error("Task error: {0}")]
|
|
Task(#[from] tokio::task::JoinError),
|
|
|
|
#[error("General error: {0}")]
|
|
General(String),
|
|
}
|
|
|
|
impl From<&str> for BackendError {
|
|
fn from(s: &str) -> Self {
|
|
Self::General(s.to_string())
|
|
}
|
|
}
|
|
|
|
impl From<String> for BackendError {
|
|
fn from(s: String) -> Self {
|
|
Self::General(s)
|
|
}
|
|
}
|
|
|
|
impl From<anyhow::Error> for BackendError {
|
|
fn from(e: anyhow::Error) -> Self {
|
|
Self::General(e.to_string())
|
|
}
|
|
}
|
|
|
|
/// Result type for backend operations
|
|
pub type Result<T> = std::result::Result<T, BackendError>;
|