1 |
use serde::{Deserialize, Serialize};
|
2 |
use std::fmt::Debug;
|
3 |
|
4 |
use crate::model::{instance::Instance, user::User};
|
5 |
|
6 |
pub mod authentication;
|
7 |
pub mod discovery;
|
8 |
pub mod error;
|
9 |
pub mod handshake;
|
10 |
pub mod issues;
|
11 |
pub mod repository;
|
12 |
pub mod user;
|
13 |
|
14 |
#[derive(Clone, Debug, Serialize, Deserialize, thiserror::Error)]
|
15 |
pub enum ErrorMessage {
|
16 |
#[error("user {0} doesn't exist or isn't valid in this context")]
|
17 |
InvalidUser(User),
|
18 |
#[error("internal error: shutdown")]
|
19 |
Shutdown,
|
20 |
}
|
21 |
|
22 |
pub trait MessageTarget {
|
23 |
fn target(&self) -> Option<Instance> {
|
24 |
None
|
25 |
}
|
26 |
}
|
27 |
|