https://github.com/mehcode/init-rs
Mark a function to run before main.
https://github.com/mehcode/init-rs
init rust
Last synced: 8 months ago
JSON representation
Mark a function to run before main.
- Host: GitHub
- URL: https://github.com/mehcode/init-rs
- Owner: mehcode
- License: apache-2.0
- Created: 2017-02-14T08:49:57.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-15T08:48:34.000Z (about 9 years ago)
- Last Synced: 2025-03-24T20:43:06.141Z (11 months ago)
- Topics: init, rust
- Language: Rust
- Size: 13.7 KB
- Stars: 11
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# init

[](https://crates.io/crates/init)
[](https://docs.rs/init)
> Mark a function to run before main.
## Install
```toml
[dependencies]
init = "0.2"
[build-dependencies]
init = "0.2"
```
## Usage
`src/main.rs`
```rust
#![feature(proc_macro)]
extern crate init;
use init::init;
#[init]
fn init() {
// [...]
}
```
`build.rs`
```rust
extern crate init;
fn main() {
init::build();
}
```
## License
Init is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).
See LICENSE-APACHE and LICENSE-MIT for details.