feat: improving docs and comments on ewwii_plugin_api
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -527,7 +527,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ewwii_plugin_api"
|
||||
version = "0.2.0"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"gtk4",
|
||||
"rhai",
|
||||
|
||||
@@ -7,8 +7,7 @@ A shared interface providing traits for building plugins for ewwii.
|
||||
A simple example showing how to use this interface is provided below:
|
||||
|
||||
```rust
|
||||
use ewwii_plugin_api::{EwwiiAPI, Plugin};
|
||||
use ewwii_plugin_api::export::export_plugin;
|
||||
use ewwii_plugin_api::{EwwiiAPI, Plugin, export_plugin};
|
||||
|
||||
pub struct DummyStructure;
|
||||
|
||||
|
||||
@@ -1,6 +1,18 @@
|
||||
//! A module implementing macros for exporting a plugin.
|
||||
//! It allows fast and easy export of plugins by abstracting
|
||||
//! the FFI (Foreign Function Interface) related code needed.
|
||||
//! A module implementing macros and similar functions
|
||||
//! for exporting a module. All the macros defined here
|
||||
//! are acessable at the root of this crate.
|
||||
//!
|
||||
//! This module also provides an example structure called
|
||||
//! [`ExamplePlugin`], which can be exported directly.
|
||||
|
||||
/// An example plugin that can be exported directly
|
||||
pub struct ExamplePlugin;
|
||||
|
||||
impl crate::Plugin for ExamplePlugin {
|
||||
fn init(&self, host: &dyn crate::EwwiiAPI) {
|
||||
host.log("Example plugin says Hello!");
|
||||
}
|
||||
}
|
||||
|
||||
/// Automatically implements `create_plugin` for a given fieldless structure
|
||||
#[macro_export]
|
||||
|
||||
@@ -8,9 +8,7 @@
|
||||
//! The following example shows how this crate shall be used to build ewwii plugins:
|
||||
//!
|
||||
//! ```rust
|
||||
//! use ewwii_plugin_api::{EwwiiAPI, Plugin};
|
||||
//! use ewwii_plugin_api::export::export_plugin;
|
||||
//!
|
||||
//! use ewwii_plugin_api::{EwwiiAPI, Plugin, export_plugin};
|
||||
//! pub struct DummyStructure;
|
||||
//!
|
||||
//! impl Plugin for DummyStructure {
|
||||
|
||||
Reference in New Issue
Block a user