ppapi

Crates.ioppapi
lib.rsppapi
version0.1.2
sourcesrc
created_at2014-11-21 08:36:19.30235
updated_at2015-12-11 23:55:08.907714
descriptionRust idiomatic bindings to parts of the Pepper API
homepage
repositoryhttps://github.com/DiamondLovesYou/rust-ppapi.git
max_upload_size
id236
size721,543
Contributors (github:productize:contributors)

documentation

http://diamondlovesyou.github.io/rust-ppapi/docs/ppapi/index.html

README

Rusted Pepper

Rust idiomatic bindings to the Pepper API. This API is experimental. Expect it to change somewhat.

Documentation

Build

You'll need to build and install the PNaCl/NaCl Rust fork first. Then run:

export NACL_SDK_ROOT=path/to/pepper_39

Lastly, run:

cargo build --target le32-unknown-nacl

And profit!

Don't run build.sh. It is used to update FFI bindings.

Getting Started

Taken from pnacl-hello-world:

#![crate_name = "pnacl-hello-world"]
#![crate_type = "bin"]
#![no_main]

extern crate ppapi;

use std::collections::HashMap;

#[no_mangle]
#[cfg(target_os = "nacl")]
// Called when an instance is created.
// This is called from a new task. It is perfectly "safe" to panic!() here, or in
// any callback (though it will result in instance termination).
pub extern fn ppapi_instance_created(_instance: ppapi::Instance,
                                     _args: HashMap<String, String>) {
    println!("Hello, world!");
}

#[no_mangle]
pub extern fn ppapi_instance_destroyed() {
}

Pepper.js

Unsupported due to rust-ppapi's use of threads.

Commit count: 192

cargo fmt