mirror of
https://github.com/icewind1991/ivory.git
synced 2026-06-03 10:44:09 +02:00
most basics of readme
This commit is contained in:
parent
c7e9171267
commit
33ffaac5d9
1 changed files with 27 additions and 0 deletions
27
README.md
Normal file
27
README.md
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# Ivory
|
||||
|
||||
Writing php extensions in rust
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
use ivory::{ivory_export, ivory_module};
|
||||
use ivory::externs::printf;
|
||||
|
||||
#[ivory_export]
|
||||
fn hello_other(other: String) {
|
||||
printf(format!("Hello {}", other));
|
||||
}
|
||||
|
||||
#[ivory_export]
|
||||
fn hello_world() {
|
||||
printf("Hello world, Rust2!");
|
||||
}
|
||||
|
||||
ivory_module!({
|
||||
name: "demo",
|
||||
version: "0.0.1",
|
||||
functions: &[hello_world, hello_other],
|
||||
info: &[("demo extension", "enabled")]
|
||||
});
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue