@ -4,14 +4,15 @@ Input handling schema written in rust. Backend agnostic, provides serializabilit
Current backends include Piston and Gilrs with more on the way.
Current backends include Piston and Gilrs with more on the way.
**NOTE** prongs requires rust 1.32 or later
**WARNING** prongs is alpha level at this point. APIs will most probably change.
**NOTE** prongs requires rust 1.32 or later.
## Using prongs library
## Using prongs library
To use the prongs library include it in your `Cargo.toml` file. You *MUST* specify a backend via features e.g.
To use the prongs library include it in your `Cargo.toml` file. You *MUST* specify a backend via features e.g.
```
```
[dependencies]
[dependencies]
prongs = { version = "1.0.2", features = ["backend_piston"] }
prongs = { version = "0.0.2", features = ["backend_piston"] }
```
```
### Documentation
### Documentation
@ -70,3 +71,8 @@ To build you need to specify the required backends e.g. `cargo build --features
Same goes for testing `cargo test --features backend_piston,backend_gilrs`
Same goes for testing `cargo test --features backend_piston,backend_gilrs`
If you don't specify a backend the tests for it will not be compiled and won't run.
If you don't specify a backend the tests for it will not be compiled and won't run.
### Adding a new backend
To add a new backend one must implement the ToEventType trait on the backend's event.
Additionally a specialized `SchemaBackendName` newtype has to be created that will hold the actual Schema object specialized to backend's types for `TEventType` and `TControllerID`.
Lastly the new schema has to be made visible in the main module under a configuration with the backend feature. Cargo.toml has to be expanded with the backend's dependencies marked optional and the new feature named.