diff --git a/Cargo.toml b/Cargo.toml index 470bacb..4e777b4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "prongs" -version = "0.0.1" +version = "0.0.2" authors = ["Ales Katona "] edition = "2018" readme = "README.md" diff --git a/README.md b/README.md index 42e3797..d4ed40c 100644 --- a/README.md +++ b/README.md @@ -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. -**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 To use the prongs library include it in your `Cargo.toml` file. You *MUST* specify a backend via features e.g. ``` [dependencies] -prongs = { version = "1.0.2", features = ["backend_piston"] } +prongs = { version = "0.0.2", features = ["backend_piston"] } ``` ### 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` 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.