3 unstable releases

0.3.0 Feb 25, 2019
0.2.1 Sep 15, 2018
0.2.0 Sep 3, 2018

#1848 in Rust patterns

25 downloads per month

MIT/Apache

7KB

slablit

Build Status Latest Version Documentation

Literal for slab creation

Usage

Add this to your Cargo.toml:

[dependencies]
slablit = "0.3"

Example

use slablit::slab;

let (slab, [first, second, third]) = slab![10, 20, 30];

lib.rs:

This crate exposes a macro slab which creates a new Slab.
It returns a tuple of the slab and the created keys as a fixed size array.

Examples

Basic

use slablit::slab;

let (slab, [first_id, second_id, third_id]) = slab!["foo", "bar", "baz"];

With Trailing Comma

use slablit::slab;

let (slab, _) = slab![
    "foo",
    "bar",
    "baz",
];

Dependencies

~44KB