records

Crates.iorecords
lib.rsrecords
version0.2.0
sourcesrc
created_at2021-12-11 20:58:00.453139
updated_at2022-01-29 03:50:51.789178
descriptionProc macro for defining data storage structs
homepagehttps://sr.ht/~hutzdog/records-rs
repositoryhttps://git.sr.ht/~hutzdog/records-rs
max_upload_size
id496330
size8,059
Danielle (enderger)

documentation

README

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);
}
Commit count: 0

cargo fmt