Improve README
This commit is contained in:
parent
d411658966
commit
50f1bcb851
35
README.md
35
README.md
|
@ -1,3 +1,38 @@
|
||||||
|
[![crates.io](https://img.shields.io/crates/v/gmod.svg)](https://crates.io/crates/gmod)
|
||||||
|
|
||||||
|
[![docs.rs](https://docs.rs/gmod/badge.svg)](https://docs.rs/gmod)
|
||||||
|
|
||||||
# ⚙ gmod-rs
|
# ⚙ gmod-rs
|
||||||
|
|
||||||
A swiss army knife for creating binary modules for Garry's Mod in Rust.
|
A swiss army knife for creating binary modules for Garry's Mod in Rust.
|
||||||
|
|
||||||
|
# Example
|
||||||
|
|
||||||
|
### Cargo.toml
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[lib]
|
||||||
|
crate-type = ["cdylib"]
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
gmod = "*"
|
||||||
|
```
|
||||||
|
|
||||||
|
### lib.rs
|
||||||
|
|
||||||
|
```rust
|
||||||
|
#[macro_use]
|
||||||
|
extern crate gmod;
|
||||||
|
|
||||||
|
#[gmod13_open]
|
||||||
|
fn gmod13_open(lua: gmod::lua::State) -> i32 {
|
||||||
|
println!("Hello from binary module!");
|
||||||
|
0
|
||||||
|
}
|
||||||
|
|
||||||
|
#[gmod13_close]
|
||||||
|
fn gmod13_close(lua: gmod::lua::State) -> i32 {
|
||||||
|
println!("Goodbye from binary module!");
|
||||||
|
0
|
||||||
|
}
|
||||||
|
```
|
|
@ -1,3 +1,4 @@
|
||||||
|
#![doc = include_str!("../../README.md")]
|
||||||
#![feature(c_unwind)]
|
#![feature(c_unwind)]
|
||||||
|
|
||||||
pub use libloading;
|
pub use libloading;
|
||||||
|
|
Loading…
Reference in New Issue