~hutzdog/records-rs

Proc macro for defining data storage structs (Rust)
72ff4be2 — Danielle Hutzley 2 years ago
Bump version
17fa91a0 — Danielle Hutzley 2 years ago
Add support for generic structs
4330ac46 — Danielle Hutzley 2 years ago
Update example, bump version

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~hutzdog/records-rs
read/write
git@git.sr.ht:~hutzdog/records-rs

You can also use your local clone with git send-email.

#Records

Records is a Rust library which adds an attribute designed for simple data classes ("records").

#What is a record?

The record attribute takes a standard named struct and

  1. Makes all it's fields pub
  2. Gives it a constructor
  3. Implements convesrsion to/from tuples

#Example

#[records::record]
pub struct Person {
  name: String,
}

pub fn main() {
  let person = Person::new(String::from("World"));
  println!("Hello, {}!", person.name);
}