add caldav mcp server

refactoring
This commit is contained in:
milan
2026-05-03 18:28:20 +02:00
parent 20a5b01311
commit 3dd897c422
14 changed files with 1342 additions and 97 deletions
+6 -4
View File
@@ -1,16 +1,18 @@
use serde::de::DeserializeOwned;
use std::path::Path;
use thiserror::Error;
use serde::de::DeserializeOwned;
#[derive(Debug, Error)]
pub enum ConfigLoadingError{
pub enum ConfigLoadingError {
#[error(transparent)]
IoError(#[from] std::io::Error),
#[error(transparent)]
ParseError(#[from] toml::de::Error),
}
pub fn config_from_file<T: DeserializeOwned>(filepath: impl AsRef<Path>) -> Result<T, ConfigLoadingError> {
pub fn config_from_file<T: DeserializeOwned>(
filepath: impl AsRef<Path>,
) -> Result<T, ConfigLoadingError> {
let toml_string: String = std::fs::read_to_string(filepath)?;
Ok(toml::from_str(&toml_string)?)
}
}
+1 -1
View File
@@ -1,2 +1,2 @@
pub mod config_loader;
pub use config_loader::config_from_file;
pub use config_loader::config_from_file;