1pub mod acl;
2pub mod client;
3pub mod config;
4pub mod git;
5pub mod logging;
6pub mod protocol;
7pub mod server;
8pub mod util;
9
10pub type Result<T> = std::result::Result<T, Error>;
11
12#[derive(Debug)]
13pub enum Error {
14 Io(std::io::Error),
15 Msg(String),
16}
17
18impl Error {
19 pub fn msg(message: impl Into<String>) -> Self {
20 Error::Msg(message.into())
21 }
22}
23
24impl From<std::io::Error> for Error {
25 fn from(err: std::io::Error) -> Self {
26 Error::Io(err)
27 }
28}
29
30impl std::fmt::Display for Error {
31 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
32 match self {
33 Error::Io(err) => write!(f, "{err}"),
34 Error::Msg(message) => write!(f, "{message}"),
35 }
36 }
37}
38
39impl std::error::Error for Error {}