fistinc_errors/repository.rs
1#[derive(Debug)]
2pub struct RepositoryError {
3 pub message: String
4}
5
6impl From<String> for RepositoryError {
7 fn from(string: String) -> Self {
8 Self {
9 message: string,
10 }
11 }
12}
13
14impl From<&str> for RepositoryError {
15 fn from(str: &str) -> Self {
16 Self {
17 message: str.to_string(),
18 }
19 }
20}
21
22pub type RepositoryResult<T> = Result<T, RepositoryError>;