fromit 0.1.2

A super powerful macro for generating new structs with getters, setters, and `From` or `TryFrom` implementation based on the given struct.
Documentation
use fromit::FromIt;

fn conv(x: &String) -> Result<Vec<u8>, std::convert::Infallible> {
  Ok(x.as_bytes().to_vec())
}

#[derive(Debug, Default, Clone, FromIt)]
#[fromit(name = "CommentGraphql", bound(inherit), debug)]
#[fromit(name = "CommentDb", bound(inherit))]
pub struct Comment<E> {
  id: String,
  user_id: String,
  post_id: String,
  parent_id: Option<String>,
  content: String,
  score: u64,
  imported: bool,
  pin: bool,
  deleted: bool,
  // #[serde(bound = "E: Extension")]
  extension: E,
}

// #[derive(FromIt)]
// #[fromit(
//   name = "FooDb",
//   converter(try_from(style = "ref")),
//   attributes(
//     derive(Clone, Debug, serde::Serialize, serde::Deserialize),
//     serde(rename_all = "camelCase")
//   )
// )]
// #[fromit(
//   name = "FooGraphql",
//   getters(prefix = "x", style = "ref"),
//   bound(
//     inherit,
//     extra = "T: Clone + core::fmt::Debug + Default, C: Copy + Default"
//   ),
//   extra(fields(
//     r#"{
//       panda: T,
//       tiger: C,
//     }"#
//   ))
// )]
// struct Foo<H: core::hash::Hash, O>
// where
//   O: Eq,
// {
//   #[fromit(
//     parent = "FooDb",
//     rename = "foo1",
//     type = "Vec<u8>",
//     from(fn = "conv"),
//     getter(style = "ref", rename = "foo"),
//     setter(style = "ref", bound = "C"),
//     attributes(serde(rename = "foo2"))
//   )]
//   #[fromit(parent = "FooGraphql", rename = "foo1", skip, type = "Vec<u8>")]
//   foo: String,
//   #[fromit(parent = "FooDb", from(style = "move"))]
//   bar: i32,
//   #[fromit(parent = "FooDb", from(style = "move"))]
//   baz: u64,
//   #[fromit(parent = "FooDb", skip)]
//   h: H,
//   #[fromit(parent = "FooDb", skip)]
//   o: O,
// }

fn main() {}