# Oden Plugin API Rust Wrapper
Rust wrapper for the Oden Plugin C API. 

## Testing
Test examples: `cargo test` will test the implemented examples using the mocked versions of the API. See the [`mockall`](https://docs.rs/mockall/latest/mockall/) crate for more information.

## Building Documentation

Build doc: `cargo doc`

Open doc: `cargo doc --open`

## How to Write Documentation
Documentation is written using [`CommonMark Markdown Specification`](https://commonmark.org/) syntax.

[`rustdoc`](https://doc.rust-lang.org/rustdoc/how-to-write-documentation.html): Guide on how to write rust style documentation

Useful commands: \
- \'#' Used to ignore showing lines of code in examples
- \'///': used for [`outer documentation`](https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html?highlight=inner#outer-and-inner-documentation), such as struct, enum, trait or function documentation
- \'//!': used for [`inner documentation`](https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html?highlight=inner#outer-and-inner-documentation) such as crate or module documentation

### Example (Outer Documentation)

```rust
/// Loads a project from the specified `path`.
/// 
/// Absolute and project-root-relative paths are supported.
/// The use of environment variables are supported as well. To use a environment variable set 
/// the name between two '%' characters for example `%HOME%/Folder/myproject.vproj`
/// ...
```

### Example (Inner Documentation)

```rust
//! Oden Rust Plugin Wrapper
//!
//! The crate oden_plugin_rs is a wrapper API for oden C++ plugin API, enabling users
//! to write plugins in rust that calls c++ functions!
//!
//! # Oden Plugin API Overview
//! ...
```

### Writing Mocked Tests

```rust
/// # use oden_plugin_rs::{ApplicationType, SettingsApi};
/// # let mut api = oden_plugin_rs::settings_api::MockSettingsApi::new();
/// # api.expect_application_type().returning(|| ApplicationType::Player);
/// # 
/// let application_type = api.application_type();
/// assert_eq!(application_type, ApplicationType::Player);
```

## License

This work is licensed under the [OBSD license](https://opensource.org/licenses/0BSD).
