label_attribute

Crates.iolabel_attribute
lib.rslabel_attribute
version0.1.1
sourcesrc
created_at2019-06-09 19:58:48.670838
updated_at2019-06-09 22:58:59.664073
descriptionProcedural attribute macro for lhlist
homepage
repositoryhttps://github.com/agnes-rs/lhlist
max_upload_size
id140040
size8,642
Jamie Blondin (jblondin)

documentation

README

lhlist

Build Status Documentation

lhlist is a library for Labeled Hetergogeneous Lists.

This library provides data structures and macros for creating and accessing lists of differently-typed objects that each have their own unique label.

For more details, see the documentation.

Usage

Add lhlist to you Cargo.toml:

[dependencies]
lhlist = "0.1"

And use it is as such:

#[macro_use] extern crate lhlist;

use lhlist::Label;

new_label![SomeNumbers: Vec<u64>];
new_label![SomeNames: Vec<&'static str>];
new_label![Flag: bool];

let my_list = lhlist![
    SomeNumbers = vec![0, 4, 5, 2],
    SomeNames = vec!["hello", "world!"],
    Flag = false,
];

assert_eq!(my_list[SomeNumbers], vec![0, 4, 5, 2]);
assert_eq!(my_list[Flag], false);

License

This project is licensed under the MIT license.

Commit count: 33

cargo fmt