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.
35 lines
616 B
35 lines
616 B
//! A library that provides basic building blocks of k-office tools
|
|
|
|
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()
|
|
}
|
|
}
|
|
|