4 releases

0.3.1 May 31, 2024
0.3.0 Feb 25, 2019
0.2.1 Sep 15, 2018
0.2.0 Sep 3, 2018

#411 in Data structures

28 downloads per month

MIT/Apache

7KB

slablit

Latest Version Documentation dependency status

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

~45KB