Sing

Std

I/o

Negotiator

Generator

Crates.io License

What is sing?

This crate is meant to create interfaces between traits in Rust libraries and the command line. It does this by providing two macros:

Usage example

```rust use serde::{Serialize, Deserialize}; use singrs::{singaddtrait, singloop};

trait FruitTree { fn shake(&self, shakes: u32) -> Vec; }

[derive(Debug, Serialize, Deserialize)]

struct Fruit { fruit_type: String, }

struct BananaTree;

[singaddtrait()]

impl FruitTree for BananaTree { fn shake(&self, shakes: u32) -> Vec{ let mut out = vec!();

              for _ in 0..shakes {
                            out.push(Fruit{fruit_type: String::from("Banana")});
              }

              out
     }

}

fn main() { let tree = BananaTree {};

sing_loop!(tree, [different, ron::to_string, ron::from_str],);

} ```

Negotiator? Really?

Yes, it's somewhat far-fetched, but I really wanted to be able to sing and clap in my rusty command-line projects.

Why the name?

See above.