#create-file #create #file #build #compile-time #proc-macro

macro build compile-time-create-file

Create files and directories at compile time using a procedural macro in Rust

3 unstable releases

0.1.0 Sep 17, 2021
0.0.2 Sep 17, 2021
0.0.1 Sep 17, 2021

#28 in #create-file

Custom license

9KB
75 lines

compile-time-create-file

Documentation crates.io CI status

Create files and directories at compile time using a procedural macro in Rust.

Example

use compile_time_create_file::create_file;

create_file!(
    "migrations/users.sql",
    "create table if not exists users (
    id serial,
    username varchar(128) not null,
    password varchar(512) not null,
    email varchar(256) not null,
    enabled boolean not null default true
);
"
);

Installation

Add compile-time-create-file = "0.0.1" under your development dependencies:

[dev-dependencies]
compile-time-create-file = "0.0.1"

Dependencies

~1.5MB
~37K SLoC