My personal project and infrastructure archive
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
nomicon/apps/koffice/libko/src/lib.rs

39 lines
699 B

//! A library that provides basic building blocks of k-office tools
#![allow(warnings)]
#[macro_use] extern crate log;
#[macro_use] pub mod log_util;
pub mod cass;
mod client;
pub use client::*;
mod invoice;
pub use invoice::*;
mod proj;
pub use proj::*;
mod store;
pub use store::*;
use serde::{de::DeserializeOwned, Serialize};
pub trait Io {
fn to_yaml(&self) -> String;
fn from_yaml(s: impl Into<String>) -> Self;
}
impl<T> Io for T
where
T: Serialize + DeserializeOwned,
{
fn to_yaml(&self) -> String {
serde_yaml::to_string(self).unwrap()
}
fn from_yaml(s: impl Into<String>) -> Self {
serde_yaml::from_str(s.into().as_str()).unwrap()
}
}